pj
Class Dump

java.lang.Object
  extended by pj.Dump

public class Dump
extends Object

output an indented tree.


Nested Class Summary
static interface Dump.Helper
          can be implemented if a class wants to do it's own dump.
 
Field Summary
protected static HashMap helpers
          helpers for some classes.
protected  String indent
          current indentation level.
protected  PrintWriter out
          output stream.
 
Constructor Summary
Dump()
          dump to standard output.
Dump(OutputStream out)
           
Dump(Writer out)
           
 
Method Summary
 String className(Class c)
          return simplified class name.
 String className(Object o)
          return simplified class name.
 void dump(Object o, boolean indented)
          dump an object.
 void println(String line)
          print one indented line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected final PrintWriter out
output stream.


indent

protected String indent
current indentation level.


helpers

protected static final HashMap helpers
helpers for some classes.

Constructor Detail

Dump

public Dump(Writer out)

Dump

public Dump(OutputStream out)

Dump

public Dump()
dump to standard output.

Method Detail

println

public void println(String line)
print one indented line.


className

public String className(Class c)
return simplified class name.


className

public String className(Object o)
return simplified class name.


dump

public void dump(Object o,
                 boolean indented)
dump an object. If it implements Collection or Map also recurse on contents.