BeanFactoryPostProcessor implementation that allows for convenient
registration of custom
PropertyEditor property editors .
As of Spring 2.0, the recommended usage is to use custom
PropertyEditorRegistrar implementations that in turn register
any desired editors on a given
org.springframework.beans.PropertyEditorRegistry registry .
Each PropertyEditorRegistrar can register any number of custom editors.
<bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="propertyEditorRegistrars">
<list>
<bean class="mypackage.MyCustomDateEditorRegistrar"/>
<bean class="mypackage.MyObjectEditorRegistrar"/>
</list>
</property>
</bean>
Alternative configuration example with custom editor instances,
assuming inner beans for PropertyEditor instances:
<bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean class="mypackage.MyCustomDateEditor"/>
</entry>
<entry key="mypackage.MyObject">
<bean id="myEditor" class="mypackage.MyObjectEditor">
<property name="myParam"><value>myValue</value></property>
</bean>
</entry>
</map>
</property>
</bean>
Also supports "java.lang.String[]"-style array class names and primitive
class names (e.g. "boolean"). Delegates to
ClassUtils for actual
class name resolution.
NOTE: Custom property editors registered with this configurer do
not apply to data binding. Custom editors for data binding need to
be registered on the
org.springframework.validation.DataBinder :
Use a common base class or delegate to common PropertyEditorRegistrar
implementations to reuse editor registration there.
author: Juergen Hoeller since: 27.02.2004 See Also: java.beans.PropertyEditor See Also: org.springframework.beans.PropertyEditorRegistrar See Also: ConfigurableBeanFactory.addPropertyEditorRegistrar See Also: ConfigurableBeanFactory.registerCustomEditor See Also: org.springframework.validation.DataBinder.registerCustomEditor See Also: org.springframework.web.servlet.mvc.BaseCommandController.setPropertyEditorRegistrars See Also: org.springframework.web.servlet.mvc.BaseCommandController.initBinder |