File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed 
spring-framework-reference/src Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -636,18 +636,8 @@ package example;
636636
637637public class ExoticTypeEditor extends PropertyEditorSupport { 
638638
639-     private String format; 
640- 
641-     public void setFormat(String format) { 
642-         this.format = format; 
643-     } 
644-      
645639    public void setAsText(String text) { 
646-         if (format != null && format.equals("upperCase")) { 
647-             text = text.toUpperCase(); 
648-         } 
649-         ExoticType type = new ExoticType(text); 
650-         setValue(type); 
640+         setValue(new ExoticType(text.toUpperCase())); 
651641    } 
652642}]]>  </programlisting >
653643			<para >Finally, we use <classname >CustomEditorConfigurer</classname > to register the new
@@ -656,11 +646,7 @@ public class ExoticTypeEditor extends PropertyEditorSupport {
656646			<programlisting  language =" xml" <![CDATA[ <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
657647  <property name="customEditors"> 
658648    <map> 
659-       <entry key="example.ExoticType"> 
660-         <bean class="example.ExoticTypeEditor"> 
661-           <property name="format" value="upperCase"/> 
662-         </bean> 
663-       </entry> 
649+       <entry key="example.ExoticType" value="example.ExoticTypeEditor"/> 
664650    </map> 
665651  </property> 
666652</bean>]]>  </programlisting >
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments