Package com.github.openjson
Enum Class JSONStringer.Scope
- All Implemented Interfaces:
Serializable
,Comparable<JSONStringer.Scope>
,Constable
- Enclosing class:
JSONStringer
Lexical scoping elements within this stringer, necessary to insert the
appropriate separator characters (ie. commas and colons) and to detect
nesting errors.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn object whose most recent element is a key.An array with no elements requires no separators or newlines before it is closed.An object with no keys or values requires no separators or newlines before it is closed.A array with at least one value requires a comma and newline before the next element.An object with at least one name/value pair requires a comma and newline before the next element.A special bracketless array needed by JSONStringer.join() and JSONObject.quote() only. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JSONStringer.Scope
Returns the enum constant of this class with the specified name.static JSONStringer.Scope[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EMPTY_ARRAY
An array with no elements requires no separators or newlines before it is closed. -
NONEMPTY_ARRAY
A array with at least one value requires a comma and newline before the next element. -
EMPTY_OBJECT
An object with no keys or values requires no separators or newlines before it is closed. -
DANGLING_KEY
An object whose most recent element is a key. The next element must be a value. -
NONEMPTY_OBJECT
An object with at least one name/value pair requires a comma and newline before the next element. -
NULL
A special bracketless array needed by JSONStringer.join() and JSONObject.quote() only. Not used for JSON encoding.
-
-
Constructor Details
-
Scope
private Scope()
-
-
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
-