commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Buckley" <>
Subject ToStringBuilder.reflectionToString
Date Wed, 16 Jul 2003 15:29:25 GMT

Is there a good way to customize ToStringBuilder.reflectionToString based on
the type of field?

For example, if a class contains a field of type java.util.Date, how can one
make ToStringBuilder.reflectionToString use a custom SimpleDateFormatter on
the field instead of Date's toString()?

[java.text.SimpleDateFormat("yyyy-MM-dd").format(myField) instead of

I saw some customization options in ToStringStyle but did not see an option
to customize formatting by type of field.

Any tips appreciated.  Thanks.


View raw message