Package jodd.json

Class PrettyJsonSerializer

java.lang.Object
jodd.json.JsonSerializer
jodd.json.PrettyJsonSerializer

public class PrettyJsonSerializer extends JsonSerializer
JsonSerializer that prints out formatted JSON. It is slower, but the output is prettier.
  • Field Details

    • deep

      private int deep
    • breakOnNewObject

      private boolean breakOnNewObject
    • identSize

      private int identSize
    • identChar

      private char identChar
    • prefixSeparatorBySpace

      private boolean prefixSeparatorBySpace
    • suffixSeparatorBySpace

      private boolean suffixSeparatorBySpace
  • Constructor Details

    • PrettyJsonSerializer

      public PrettyJsonSerializer()
  • Method Details

    • identSize

      public void identSize(int ident)
      Defines ident size in number of identChar to be used for single indentation.
    • identChar

      public void identChar(char identChar)
      Sets ident character. Usually its a space or a tab.
    • breakLine

      private void breakLine(JsonContext jsonContext)
    • ident

      private void ident(JsonContext jsonContext)
    • createJsonContext

      public JsonContext createJsonContext(Appendable appendable)
      Description copied from class: JsonSerializer
      Creates new JSON context.
      Overrides:
      createJsonContext in class JsonSerializer