Package com.yahoo.vespa.objects
Class ObjectDumper
- java.lang.Object
-
- com.yahoo.vespa.objects.ObjectVisitor
-
- com.yahoo.vespa.objects.ObjectDumper
-
public class ObjectDumper extends ObjectVisitor
This is a concrete object visitor that will build up a structured human-readable string representation of an object.- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description ObjectDumper()
Create an object dumper with the default indent size.ObjectDumper(int indent)
Create an object dumper with the given indent size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeStruct()
Close a (sub-)structurevoid
openStruct(String name, String type)
Open a (sub-)structureString
toString()
Obtain the created object string representation.void
visit(String name, Object obj)
Visits some object.
-
-
-
Method Detail
-
toString
public String toString()
Obtain the created object string representation. This object should be invoked after the complete object structure has been visited.
-
openStruct
public void openStruct(String name, String type)
Description copied from class:ObjectVisitor
Open a (sub-)structure- Specified by:
openStruct
in classObjectVisitor
- Parameters:
name
- name of structuretype
- type of structure
-
closeStruct
public void closeStruct()
Description copied from class:ObjectVisitor
Close a (sub-)structure- Specified by:
closeStruct
in classObjectVisitor
-
visit
public void visit(String name, Object obj)
Description copied from class:ObjectVisitor
Visits some object.- Specified by:
visit
in classObjectVisitor
- Parameters:
name
- variable nameobj
- object to visit
-
-