Klasse PrettyPrint

java.lang.Object
com.restfb.json.PrettyPrint
Alle implementierten Schnittstellen:
WriterConfig

public class PrettyPrint extends Object implements WriterConfig
Enables human readable JSON output by inserting whitespace between values.after commas and colons. Example:
 jsonValue.writeTo(writer, PrettyPrint.singleLine());
 
  • Konstruktordetails

    • PrettyPrint

      protected PrettyPrint(char[] indentChars)
  • Methodendetails

    • singleLine

      public static PrettyPrint singleLine()
      Print every value on a separate line. Use tabs (\t) for indentation.
      Gibt zurück:
      A PrettyPrint instance for wrapped mode with tab indentation
    • indentWithSpaces

      public static PrettyPrint indentWithSpaces(int number)
      Print every value on a separate line. Use the given number of spaces for indentation.
      Parameter:
      number - the number of spaces to use
      Gibt zurück:
      A PrettyPrint instance for wrapped mode with spaces indentation
    • indentWithTabs

      public static PrettyPrint indentWithTabs()
      Do not break lines, but still insert whitespace between values.
      Gibt zurück:
      A PrettyPrint instance for single-line mode
    • createWriter

      public com.restfb.json.JsonWriter createWriter(Writer writer)
      Angegeben von:
      createWriter in Schnittstelle WriterConfig