[ajug-members] object toString utility using reflection?

Curt Smith csmith at javadepot.com
Tue Aug 21 19:18:34 EDT 2007


I just reached wits end with a major short coming with Java, in that 
object.toString() doesn't dump state including referenced objects.  This 
is a major pain with corba/SOAP when all of your DTO classes are 
generated.  This feature should have been apart of the JDK since 1.0.  
If so how much debugging time would this have saved all you old timers 
who have suffered with logs from junior types that just say:  "got 
here", or "error".  LOL!   Or maybe we should volunteer an extra page or 
two for Nutshell Java on debug ability of your java code.  :)

I'm aware of and recommend the Eclipse plugin:  Jutils that right-click 
generate toString() method for any pojo.  it's great when you own the 
source. This won't help with Corba and SOAP interfaces and you want to 
log the request and response and don't want to write a dump utility for 
every interface class.  Or modify the generated code.

Is there a reflection based utility class that can return a string of a 
given classes state?

tnx,
curt smith



More information about the ajug-members mailing list