From 812b26b932ce23a0210589f43a731b52b357ee5c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 20 Jan 2010 09:20:30 +0000 Subject: [PATCH] updated CustomEditorConfigurer example to recommended style (SPR-5971) git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2837 50f2f4bb-b051-0410-bef5-90022cba6387 --- spring-framework-reference/src/validation.xml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/spring-framework-reference/src/validation.xml b/spring-framework-reference/src/validation.xml index bd6633c4875..11c78f03bfa 100644 --- a/spring-framework-reference/src/validation.xml +++ b/spring-framework-reference/src/validation.xml @@ -636,18 +636,8 @@ package example; public class ExoticTypeEditor extends PropertyEditorSupport { - private String format; - - public void setFormat(String format) { - this.format = format; - } - public void setAsText(String text) { - if (format != null && format.equals("upperCase")) { - text = text.toUpperCase(); - } - ExoticType type = new ExoticType(text); - setValue(type); + setValue(new ExoticType(text.toUpperCase())); } }]]> Finally, we use CustomEditorConfigurer to register the new @@ -656,11 +646,7 @@ public class ExoticTypeEditor extends PropertyEditorSupport { - - - - - + ]]>