com.intersys.objects
Class ObjectDump.PrintStreamDumper

java.lang.Object
  extended bycom.intersys.objects.ObjectDump.PrintStreamDumper
All Implemented Interfaces:
ObjectDump.Dumper
Enclosing class:
ObjectDump

public static class ObjectDump.PrintStreamDumper
extends Object
implements ObjectDump.Dumper


Constructor Summary
ObjectDump.PrintStreamDumper(OutputStream w)
           
ObjectDump.PrintStreamDumper(Writer w)
           
 
Method Summary
 void dump(String name, Object value, ObjectHandle object)
          This method is called to dump literal value of a field
 void handleNullObject(ObjectHandle current, String fieldName)
           
 boolean indent(Object o, ObjectHandle object, String fieldName)
          This method is called to indicate start printing of "child" object, i.e.
 void print(Object obj)
          This method is called to print a simple object
 void println(Object obj)
          This method is called to print a simple object and and then terminate the line.
 void printReference(ObjectHandle oh, ObjectHandle cur, String fieldName)
          This method is called if an object that has already been printed before is encountered.
 void undent()
          This method is called to indicate end of printing of "child" object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectDump.PrintStreamDumper

public ObjectDump.PrintStreamDumper(Writer w)

ObjectDump.PrintStreamDumper

public ObjectDump.PrintStreamDumper(OutputStream w)
Method Detail

print

public void print(Object obj)
Description copied from interface: ObjectDump.Dumper
This method is called to print a simple object

Specified by:
print in interface ObjectDump.Dumper
Parameters:
obj - Value of object to be printed, in most cases just a String.

println

public void println(Object obj)
Description copied from interface: ObjectDump.Dumper
This method is called to print a simple object and and then terminate the line.

Specified by:
println in interface ObjectDump.Dumper
Parameters:
obj - Value of object to be printed, in most cases just a String

dump

public void dump(String name,
                 Object value,
                 ObjectHandle object)
Description copied from interface: ObjectDump.Dumper
This method is called to dump literal value of a field

Specified by:
dump in interface ObjectDump.Dumper
Parameters:
name - Name of the field
value - Value of the field
object - Object being dumped. This is sent for information only and can be disregarded.

indent

public boolean indent(Object o,
                      ObjectHandle object,
                      String fieldName)
Description copied from interface: ObjectDump.Dumper
This method is called to indicate start printing of "child" object, i.e. a value of a field which is an object itself.If the method returns false, then child object is not printed.

Specified by:
indent in interface ObjectDump.Dumper
Parameters:
o - childObject This parameter should be used only to determine whether to print this object, there is no need to print it. If the method returns true, then the object will be sent for printing subsequently.
object - Current object being dumped. This is sent for information only and can be disregarded.
fieldName - Field in current object which corresponds to child object.
Returns:
whether to recurs into printing passed object.

undent

public void undent()
Description copied from interface: ObjectDump.Dumper
This method is called to indicate end of printing of "child" object. After that fields of "parent" object will be coninued to be printed.

Specified by:
undent in interface ObjectDump.Dumper

printReference

public void printReference(ObjectHandle oh,
                           ObjectHandle cur,
                           String fieldName)
Description copied from interface: ObjectDump.Dumper
This method is called if an object that has already been printed before is encountered.

Specified by:
printReference in interface ObjectDump.Dumper
Parameters:
oh - Object that has been encountered and has been already printed.
cur - Current object being dumped. This is sent for information only and can be disregarded.
fieldName - Field in current object which corresponds to child object.

handleNullObject

public void handleNullObject(ObjectHandle current,
                             String fieldName)
Specified by:
handleNullObject in interface ObjectDump.Dumper