Christian Catchpole wrote:
> I guess regardless of the output format you end up choosing, you could
> write a static reflective toString generator and call that in your
> toString methods. perhaps with some varargs to list exclusions which
> you don't want to expose (or even private fields to include).
>
> public String toString() {
> return ToString.tostringificator(this, "field7", "field12");
> }
>
>
Check out jakarta commons lang ReflectionToStringBuilder. I always use
this in my value objects. Likewise ReflectionHashcodeBuilder and
ReflectionEqualsBuilder.
- Neil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---