|
From: Alef A. <al...@jt...> - 2004-03-05 15:51:19
|
It's not possible to do this via a static on the BeanWrapper. It IS =
possible
however...
J=FCrgen added a CustomEditorConfigurer that you can use to do this. =
Just add
it to you app context and you're done.
<!-- taken from JavaDOC -->
<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"mypackage.MyCustomDateEditor"/>
</entry>
<entry key=3D"mypackage.MyObject">
<bean id=3D"myEditor" class=3D"mypackage.MObjectEditor">
<property name=3D"myParam"><value>myValue</value></property>
</bean>
</entry>
</map>
</property>
</bean>
If you're programmatically using the BeanFactory, you can add
propertyeditors using registerCustomEditor from the BeanFactory (or use =
a
BeanFactoryPostProcessor).
Alef
=09
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...] On =
Behalf
> Of Chris Winters
> Sent: Friday, March 05, 2004 4:17 PM
> To: Spring-Dev
> Subject: [Springframework-developer] "permanantly" registering =
property
> editor with BeanWrapper?
>=20
> Is there a way to permanantly (for the life of the current JVM
> instance) register a property editor for the BeanWrapper
> (BeanWrapperImpl) to use? I see it maintains a static map of
> 'defaultEditors' but it looks like custom editors have to be
> registered with each wrapper instance.
>=20
> Would it be possible to add a:
>=20
> static void registerCustomerEditor( Class c, PropertyEditor e )
>=20
> or something similar that adds a custom editor to the default (or
> global) editors?
>=20
> Thanks,
>=20
> Chris
>=20
> --
> Chris Winters (cwi...@op...)
> Senior Software Architect
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> =
administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli=
ck
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|