Package uk.blankaspect.common.json
Enum Class OutputMode
- All Implemented Interfaces:
Serializable
,Comparable<OutputMode>
,Constable
This is an enumeration of the ways in which a JSON generator can write whitespace between the tokens of the JSON
text.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionJSON text is written on a single line with a space between some tokens.JSON text is written on a single line with no space between tokens.JSON text may be written on multiple lines with a space between some tokens.JSON text may be written on multiple lines with a space between some tokens. -
Method Summary
Modifier and TypeMethodDescriptionstatic OutputMode
Returns the enum constant of this class with the specified name.static OutputMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DENSE
JSON text is written on a single line with no space between tokens. -
COMPACT
JSON text is written on a single line with a space between some tokens. -
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
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.
-
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
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-