Here's what I'd like to do. I have an object that does not have a
toString() method. I'd like to output what's contained in it in a
generic way for debugging. I've written the beginnings of a static
method to print out an object with reflection, but if there's a library
or code out there that already does this it would be better. I'm mostly
interested in the fields to show the data structure.I would think that
this would be a common problem, but in all of my searching I couldn't
find anything. Thanks for the help!
-----Horndude77
Luc The Perverse - 19 Nov 2005 05:39 GMT
> Here's what I'd like to do. I have an object that does not have a
> toString() method. I'd like to output what's contained in it in a
[quoted text clipped - 4 lines]
> this would be a common problem, but in all of my searching I couldn't
> find anything. Thanks for the help!
Really depends on what the object is. Typically I have found that by just
exporting the relevant information, either to a file, or just to a console
window that I can focus my effort on figuring out the problem.

Signature
LTP
Real Gagnon - 19 Nov 2005 14:42 GMT
> Here's what I'd like to do. I have an object that does not have a
> toString() method. I'd like to output what's contained in it in a
[quoted text clipped - 4 lines]
> this would be a common problem, but in all of my searching I couldn't
> find anything. Thanks for the help!
See http://www.rgagnon.com/javadetails/java-0432.html
for an generic toString() method.
Bye.

Signature
Real Gagnon from Quebec, Canada
* Looking for Java or PB code examples ? Visit Real's How-to
* http://www.rgagnon.com/howto.html