|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.config.CustomEditorConfigurer
public class CustomEditorConfigurer
BeanFactoryPostProcessor implementation that allows for convenient registration of custom property editors.
Configuration example, assuming XML bean definitions and 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 DataBinder: Use a common base class or delegate to common DataBinder initialization code to reuse editor registration there.
ConfigurableBeanFactory.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)
,
ClassUtils.forName(java.lang.String)
,
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)
,
BaseCommandController.initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)
Constructor Summary | |
---|---|
CustomEditorConfigurer()
|
Method Summary | |
---|---|
int |
getOrder()
Return the order value of this object, higher value meaning greater in terms of sorting. |
void |
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Modify the application context's internal bean factory after its standard initialization. |
void |
setCustomEditors(Map customEditors)
Specify the custom editors to register via a Map, using the class name of the required type as key and the PropertyEditor instance as value. |
void |
setOrder(int order)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CustomEditorConfigurer()
Method Detail |
---|
public void setOrder(int order)
public int getOrder()
Ordered
Higher value can be interpreted as lower priority, consequently the first object has highest priority (somewhat analogous to Servlet "load-on-startup" values).
public void setCustomEditors(Map customEditors)
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
BeanFactoryPostProcessor
postProcessBeanFactory
in interface BeanFactoryPostProcessor
beanFactory
- the bean factory used by the application context
BeansException
- in case of errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |