Class PrettyPrinter

java.lang.Object
com.comphenix.protocol.reflect.PrettyPrinter

public class PrettyPrinter extends Object
Used to print the content of an arbitrary class.
  • Field Details

    • RECURSE_DEPTH

      public static final int RECURSE_DEPTH
      How far we will recurse.
      See Also:
  • Constructor Details

    • PrettyPrinter

      public PrettyPrinter()
  • Method Details

    • printObject

      public static String printObject(Object object) throws IllegalAccessException
      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