Enum Class OutputMode

java.lang.Object
java.lang.Enum<OutputMode>
uk.blankaspect.common.json.OutputMode
All Implemented Interfaces:
Serializable, Comparable<OutputMode>, Constable

public enum OutputMode extends Enum<OutputMode>
This is an enumeration of the ways in which a JSON generator can write whitespace between the tokens of the JSON text.
  • Enum Constant Details

    • DENSE

      public static final OutputMode DENSE
      JSON text is written on a single line with no space between tokens.
    • COMPACT

      public static final OutputMode COMPACT
      JSON text is written on a single line with a space between some tokens.
    • NORMAL

      public static final OutputMode NORMAL
      JSON text may be written on multiple lines with a space between some tokens. Compound values (array and object) are written on a single line in some cases:
      • The opening and closing brackets and elements of an array are written on a single line if they all fit on the line; otherwise, they are split over multiple lines, as necessary.
      • An object is written on a single line if it is empty or contains a single member that fits on the line along with its opening and closing braces; otherwise, its members and closing brace are each written on a separate line, and a NewLineBeforeLeftBracket parameter determines whether the opening brace is written on a separate line.
    • EXPANDED

      public static final OutputMode EXPANDED
      JSON text may be written on multiple lines with a space between some tokens. Compound values (array and object) are written on a single line in some cases:
      • An empty array is written on a single line. The elements and closing bracket of a non-empty array are each written on a separate line, and the opening bracket is written on a separate line if the opening bracket on same line flag is false.
      • An empty object is written on a single line. The members and closing brace of a non-empty object are each written on a separate line, and a NewLineBeforeLeftBracket parameter determines whether the opening brace is written on a separate line.
  • Method Details

    • values

      public static OutputMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OutputMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null