[ajug-members] object toString utility using reflection?

Sony Antony sony.antony at gmail.com
Tue Aug 21 22:57:24 EDT 2007


Sometimes back I wrote a PrintAny( ORB, Object ) method for corba that
prints an object along with all its contained/referenced objects.

email me if you are interested in the code.

--sony


On 8/21/07, Curt Smith <csmith at javadepot.com> wrote:
> 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
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members
>



More information about the ajug-members mailing list