|
|||||||||||
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
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. Delegates to ClassUtils for actual class name resolution.
ConfigurableBeanFactory.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)
,
ClassUtils.forName(java.lang.String)
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).
getOrder
in interface Ordered
public void setCustomEditors(Map customEditors)
ConfigurableBeanFactory.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)
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 |