Data::Dumper for java



Perl has a very nice class called Data::Dumper which recursively
prints out data structures and objects, such that if an object owns
other objects, those too are printed out in 'standardized' form (ie:
showing all public and private fields of those subobjects).

Is there an equivalent module in java?

I know you could make one using reflection; my question is *has*
someone made one, one that is tunable (ie: that can override objects'
toString() methods, shows only so many levels of output, etc. Being
able to override toString() for subobjects is very important because
Java so helpfully provides a somewhat meaningless toString() function
for Object)

Thanks much for any info,

Ed
.



Relevant Pages

  • Re: Data::Dumper for java
    ... one that is tunable (ie: that can override objects' ... toString() methods, shows only so many levels of output, etc. ... Java so helpfully provides a somewhat meaningless toStringfunction ... For debugging, my debugger shows me all I need, with out any work whatsoever on my part. ...
    (comp.lang.java.programmer)
  • Re: Impossible to pass implicitly vairable names of values by explicitly passing the other?
    ... I have thought about a similar trick before. ... Java library objects, ... If the object in question are your own, override the toString() ... You can also override the toStringmethod in an anonymous inner ...
    (comp.lang.java.programmer)
  • Re: ***Javaprogramm gibt falsche Ausgabe aus***
    ... String konvertieren, welcher dann ausgegeben wird. ... benutzt Java die Methode toString(). ... Bei einem Array ...
    (de.comp.lang.java)
  • Re: Bibliothekserweiterungen in C
    ... Die Laufzeitumgebung in Java kann annehmen, das für jedes Objekt eine Funktion toStringbereitsteht. ... Über die Vererbungsautomatik bei der Erstellung neuer Objekte wird immer dafür gesorgt, das wenigstens eine Standard-Implementierung beigefügt ist. ... man selbst den Aufwand treiben und sicherstellen, das in JEDER Struktur einen Funktionszeiger auf die toString() Funktion existiert. ...
    (de.comp.lang.c)
  • Re: AspectJ: solution to Javas repetitiveness?
    ... While I'm very impressed with the Eclipse IDE for Java and the ... equal, toString(), toXML, fromString, fromXMLfor all of them. ... Perhaps for very simple classes whose instance variables are ... equals() and hashCode... ...
    (comp.lang.java.programmer)