Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Object Printer

Thread view: 
horndude77@gmail.com - 19 Nov 2005 04:51 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
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.