commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Slonim, Greg \(Contractor\)" <greg_slo...@fanniemae.com>
Subject [Commons Digester 1.6] Custom properties class converters
Date Tue, 01 Mar 2005 20:27:59 GMT
When Digester is populating properties on the bean it uses
org.apache.commons.beanutils.BeanUtils.populate(Object, Map) to populate
object's values. BeanUtilsBean uses various implementations of
org.apache.commons.beanutils.Converter to convert the values from
Strings to particular types of objects. Sometimes the default converters
do not work as intended. Example: I have java.util.Date fields in my
bean among other things. XML data is coming in in format yyyy-MM-dd and
it breaks the conversion. I have to manually register
DataLocaleConverter for this to work. Is there an elegant way to solve
this problem without explicitly doing

ConvertUtils.register(new DateLocaleConverter(null, Locale.US,
"yyyy-MM-dd"), Date.class);

in my code?

Regards,
 
Greg Slonim
Senior Software Consultant
Finance and Portfolio Technologies
Fannie Mae, Washington DC
202-752-3820

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message