commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-commons Wiki] Update of "BeanUtils/FAQ" by SimonKitching
Date Wed, 15 Jun 2005 10:16:16 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" for change notification.

The following page has been changed by SimonKitching:
http://wiki.apache.org/jakarta-commons/BeanUtils/FAQ

The comment on the change is:
Added info re ConvertUtils conversions from X to String

------------------------------------------------------------------------------
  FAQ entry titled "How can I correctly convert locale-specific input?" for specific information
  about this.
  
+ === How can I customise conversions from type X to String? ===
+ 
+ Sorry, but !ConvertUtils isn't really designed to do that. It is fundamentally about mapping
strings
+ (from xml input or web forms, etc) to objects.
+ 
+ The standard converter to the String type simply calls toString on its input object, so
you can customise the
+ output for objects of any particular class by modifying the toString method of that class.
+ 
+ Or you could replace the converter for target type String.class with a custom converter
which inspects the type
+ of the object and does a big switch statement. Or maybe even look up a mapping table of
subconverter objects 
+ based on the type of the object being converted.
+ 
+ But in general if you need to do this, then !ConvertUtils is probably the wrong tool for
your job. You might like
+ to look at morph.sourceforge.net, google for alternatives or craft your own solution.
+ 
  === Why do I get ConversionException when using RowSetDynaClass with Oracle? ===
  
  Oracle's JDBC driver is broken. When a query is run against a table containing a Timestamp
column,

---------------------------------------------------------------------
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