Package com.yahoo.vespa.objects
Class ObjectDumper
java.lang.Object
com.yahoo.vespa.objects.ObjectVisitor
com.yahoo.vespa.objects.ObjectDumper
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
ConstructorDescriptionCreate an object dumper with the default indent size.ObjectDumper
(int indent) Create an object dumper with the given indent size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Close a (sub-)structurevoid
openStruct
(String name, String type) Open a (sub-)structuretoString()
Obtain the created object string representation.void
Visits some object.
-
Constructor Details
-
ObjectDumper
public ObjectDumper()Create an object dumper with the default indent size. -
ObjectDumper
public ObjectDumper(int indent) Create an object dumper with the given indent size.- Parameters:
indent
- indent size in number of spaces
-
-
Method Details
-
toString
Obtain the created object string representation. This object should be invoked after the complete object structure has been visited. -
openStruct
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
Description copied from class:ObjectVisitor
Visits some object.- Specified by:
visit
in classObjectVisitor
- Parameters:
name
- variable nameobj
- object to visit
-