|
From: <jue...@we...> - 2004-02-27 16:54:42
|
Just added!
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of j=FCrgen h=F6ller [werk3AT]
Sent: Wednesday, February 25, 2004 5:46 PM
To: spr...@li...
Subject: RE: [Springframework-developer] Suggestion: Generic
BeanFactoryPostProcessor for registering custom PropertyEditors
That indeed sounds useful. However, specifying the class name is often =
not enough, as you might have to customize the editor instance. Of =
course, you can do that in code, i.e. your own BeanFactoryPostProcessor =
implementation.
A generic CustomEditorConfigurer could take a map with editor instances =
as values to achieve the same for simple enough editors. As the editors =
won't be needed otherwise, it would be convenient to define them as =
inner beans:
<bean id=3D"customEditorConfigurer"
=
class=3D"org.springframework.beans.factory.config.CustomEditorConfigurer"=
>
<property name=3D"customEditors">
<map>
<entry key=3D"java.util.Date">
<bean class=3D"com.acme.MyCustomDateEditor"/></bean>
</entry>
<entry key=3D"mypackage.MyObject">
<bean id=3D"myEditor" class=3D"mypackage.MyEditor">
<property name=3D"myParam"><value>myValue</value></property>
</bean>
</entry>
</map>
</property>
</bean>
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of Daniel Potter
Sent: Wednesday, February 25, 2004 5:01 PM
To: spr...@li...
Subject: [Springframework-developer] Suggestion: Generic
BeanFactoryPostProcessor for registering custom PropertyEditors
I'd like to suggest adding a convenience BeanFactoryPostProcessor
implementation to org.springframework.beans.factory.config to register
custom PropertyEditors. This seems like a very common need and an easy
addition. Maybe something like:
<bean id=3D"customEditorConfigurer"
=
class=3D"org.springframework.beans.factory.config.CustomEditorConfigurer"=
>
<property name=3D"customEditors">
<map>
<entry key=3D"java.util.Date">
<value>com.acme.MyCustomDateEditor</value>i
</entry>
</map>
</property>
</bean>
The CustomEditorConfigurer bean would just iterate over the map entries
and call beanFactory.registerCustomerEditor() for each using the
specified property class and custom editor.
Seems like a simple and useful addition to the core framework.
Any thoughts?
Daniel
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id438&op=3Dick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|