commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel McAllansmith <>
Subject [betwixt] 1.0 beta dev Object <-> String conversion
Date Thu, 04 Sep 2003 00:13:03 GMT
Hello all,

the ability to do custom Object<->String conversion  provided in the beta 
looks really useful, unfortunately I'm having some trouble getting it 

Given a bean class, TestBean, with getLocale() and setLocale(Locale) methods I 
thought it would be sufficient to add
before writing out the TestBean instance to get my LocaleConverter used.

This doesn't seem to be the case.
LocaleConverter.objectToString(..) is not called.
However if I add getName() setName(String) to TestBean then LocaleConverter is 
called upon to convert the name (but still not the locale).
(BTW: LocaleConverter has nothing to do with the one in beanutils.)

Digging through the code it seems that I can hack XmlHelperUtils to change 
what types are considered as primitives so that an ElementDescriptor is not 
created and the converter is used instead.  This seems a bit dodgy for Locale 
and _real_ dodgy for non java classes.

Am I blind?  Is there a better way?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message