From ddbcf62edd187944145480c73ed4c98d85dd3432 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 3 May 2013 13:56:57 +0200 Subject: [PATCH] Replaced shared editor usage with PropertyEditorRegistrar --- .../jmx/export/CustomDateEditorRegistrar.java | 36 +++++++++++++++++++ .../jmx/export/customConfigurer.xml | 31 +++------------- 2 files changed, 41 insertions(+), 26 deletions(-) create mode 100644 spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java diff --git a/spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java b/spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java new file mode 100644 index 0000000000..e85640fdc5 --- /dev/null +++ b/spring-context/src/test/java/org/springframework/jmx/export/CustomDateEditorRegistrar.java @@ -0,0 +1,36 @@ +/* + * Copyright 2002-2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package org.springframework.jmx.export; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.springframework.beans.PropertyEditorRegistrar; +import org.springframework.beans.PropertyEditorRegistry; +import org.springframework.beans.propertyeditors.CustomDateEditor; + +/** + * @author Juergen Hoeller + */ +public class CustomDateEditorRegistrar implements PropertyEditorRegistrar { + + @Override + public void registerCustomEditors(PropertyEditorRegistry registry) { + registry.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy/MM/dd"), true)); + } + +} diff --git a/spring-context/src/test/java/org/springframework/jmx/export/customConfigurer.xml b/spring-context/src/test/java/org/springframework/jmx/export/customConfigurer.xml index dea76ccada..04a8a9274a 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/customConfigurer.xml +++ b/spring-context/src/test/java/org/springframework/jmx/export/customConfigurer.xml @@ -4,41 +4,20 @@ - - - - - - - - yyyy/MM/dd - - - - - true - - - - + + - - 2004/10/12 - - - 2004/11/13 - + + - - - +