Package com.comphenix.protocol.reflect
Class PrettyPrinter
java.lang.Object
com.comphenix.protocol.reflect.PrettyPrinter
Used to print the content of an arbitrary class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents a generic object printer. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringprintObject(Object object) Print the contents of an object.static StringprintObject(Object object, Class<?> start, Class<?> stop) Print the contents of an object.static StringprintObject(Object object, Class<?> start, Class<?> stop, int hierachyDepth) Print the contents of an object.static StringprintObject(Object object, Class<?> start, Class<?> stop, int hierachyDepth, PrettyPrinter.ObjectPrinter printer) Print the contents of an object.
-
Field Details
-
RECURSE_DEPTH
public static final int RECURSE_DEPTHHow far we will recurse.- See Also:
-
-
Constructor Details
-
PrettyPrinter
public PrettyPrinter()
-
-
Method Details
-
printObject
Print the contents of an object.- Parameters:
object- - the object to serialize.- Returns:
- String representation of the class.
- Throws:
IllegalAccessException- If the object is null
-
printObject
public static String printObject(Object object, Class<?> start, Class<?> stop) throws IllegalAccessException Print the contents of an object.- Parameters:
object- - the object to serialize.start- - class to start at.stop- - superclass that will stop the process.- Returns:
- String representation of the class
- Throws:
IllegalAccessException- If the object is null
-
printObject
public static String printObject(Object object, Class<?> start, Class<?> stop, int hierachyDepth) throws IllegalAccessException Print the contents of an object.- Parameters:
object- - the object to serialize.start- - class to start at.stop- - superclass that will stop the process.hierachyDepth- - maximum recursion level.- Returns:
- String representation of the class.
- Throws:
IllegalAccessException- If the object is null
-
printObject
public static String printObject(Object object, Class<?> start, Class<?> stop, int hierachyDepth, PrettyPrinter.ObjectPrinter printer) throws IllegalAccessException Print the contents of an object.- Parameters:
object- - the object to serialize.start- - class to start at.stop- - superclass that will stop the process.hierachyDepth- - maximum recursion level.printer- - a generic object printer.- Returns:
- String representation of the class.
- Throws:
IllegalAccessException- If the object is null
-