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
ConstructorsConstructorDescriptionCreate an object dumper with the default indent size.ObjectDumper(int indent) Create an object dumper with the given indent size. -
Method Summary
Modifier and TypeMethodDescriptionvoidClose a (sub-)structurevoidopenStruct(String name, String type) Open a (sub-)structuretoString()Obtain the created object string representation.voidVisits 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:ObjectVisitorOpen a (sub-)structure- Specified by:
openStructin classObjectVisitor- Parameters:
name- name of structuretype- type of structure
-
closeStruct
public void closeStruct()Description copied from class:ObjectVisitorClose a (sub-)structure- Specified by:
closeStructin classObjectVisitor
-
visit
Description copied from class:ObjectVisitorVisits some object.- Specified by:
visitin classObjectVisitor- Parameters:
name- variable nameobj- object to visit
-