public static enum JSONStreamReader.ParseState extends java.lang.Enum<JSONStreamReader.ParseState>
nextState()
loop are a subset of
these states.
The states are similar in convention to the write methods in
JSONWriter
, such as pairing OBJECT
with END_OBJECT
,
and ARRAY
with END_ARRAY
.
Enum Constant and Description |
---|
ARRAY
Start a JSON array
|
BOOLEAN_VALUE
The
Boolean.TRUE or Boolean.FALSE value |
DOCUMENT
Start a JSON document
|
END_ARRAY
End a JSON array
|
END_DOCUMENT
End a JSON document
|
END_OBJECT
End a JSON object
|
INIT
Internal state -- before the DOCUMENT state
|
KEY
A key of a JSON object
|
KEY_SEPARATOR
Internal state -- between a KEY and *_VALUE states
|
NULL_VALUE
The
JSONObject.Null value |
NUMBER_VALUE
A
Number value |
OBJECT
Start a JSON object
|
STRING_VALUE
A
String value |
VALUE_SEPARATOR
Internal state -- after a *_VALUE state
|
Modifier and Type | Method and Description |
---|---|
boolean |
isArrayDelimiter()
Is this state an array delimiter -- that is, either an
ARRAY or an END_ARRAY state. |
boolean |
isBeginStructure()
Is this state a beginning of a JSON structure -- that is, one of
DOCUMENT , OBJECT , or ARRAY . |
boolean |
isDocumentDelimiter()
Is this state a document delimiter -- that is, either a
DOCUMENT or an END_DOCUMENT state. |
boolean |
isEndStructure()
Is this state an end of a JSON structure -- that is, one of
END_DOCUMENT , END_OBJECT , or END_ARRAY . |
boolean |
isInternal()
Is this state an internal state -- that is, one that would not
be returned from the
nextState()
method. |
boolean |
isObjectDelimiter()
Is this state an object delimiter -- that is, either an
OBJECT or an END_OBJECT state. |
boolean |
isSeparator()
Is this state a separator -- that is, either a
KEY_SEPARATOR
or a VALUE_SEPARATOR . |
boolean |
isText()
Is this state a text state -- that is, either a
KEY or
a STRING_VALUE state. |
boolean |
isValue()
Is this state a value state -- that is, one of
NULL_VALUE ,
BOOLEAN_VALUE , NUMBER_VALUE , or STRING_VALUE |
static JSONStreamReader.ParseState |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JSONStreamReader.ParseState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JSONStreamReader.ParseState INIT
public static final JSONStreamReader.ParseState DOCUMENT
public static final JSONStreamReader.ParseState OBJECT
public static final JSONStreamReader.ParseState END_OBJECT
public static final JSONStreamReader.ParseState ARRAY
public static final JSONStreamReader.ParseState END_ARRAY
public static final JSONStreamReader.ParseState KEY_SEPARATOR
public static final JSONStreamReader.ParseState VALUE_SEPARATOR
public static final JSONStreamReader.ParseState KEY
public static final JSONStreamReader.ParseState NULL_VALUE
JSONObject.Null
valuepublic static final JSONStreamReader.ParseState BOOLEAN_VALUE
Boolean.TRUE
or Boolean.FALSE
valuepublic static final JSONStreamReader.ParseState NUMBER_VALUE
Number
valuepublic static final JSONStreamReader.ParseState STRING_VALUE
String
valuepublic static final JSONStreamReader.ParseState END_DOCUMENT
public static JSONStreamReader.ParseState[] values()
for (JSONStreamReader.ParseState c : JSONStreamReader.ParseState.values()) System.out.println(c);
public static JSONStreamReader.ParseState valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isInternal()
nextState()
method.true
to indicate an internal state, otherwise false
public boolean isValue()
NULL_VALUE
,
BOOLEAN_VALUE
, NUMBER_VALUE
, or STRING_VALUE
true
to indicate a value state, otherwise false
public boolean isBeginStructure()
DOCUMENT
, OBJECT
, or ARRAY
.true
to indicate a beginning of a JSON structure,
otherwise false
public boolean isEndStructure()
END_DOCUMENT
, END_OBJECT
, or END_ARRAY
.true
to indicate an end of a JSON structure,
otherwise false
public boolean isText()
KEY
or
a STRING_VALUE
state.true
to indicate a text state, otherwise false
public boolean isDocumentDelimiter()
DOCUMENT
or an END_DOCUMENT
state.true
to indicate a document delimiter state,
otherwise false
public boolean isObjectDelimiter()
OBJECT
or an END_OBJECT
state.true
to indicate an object delimiter state,
otherwise false
public boolean isArrayDelimiter()
ARRAY
or an END_ARRAY
state.true
to indicate an array delimiter state,
otherwise false
public boolean isSeparator()
KEY_SEPARATOR
or a VALUE_SEPARATOR
.true
to indicate a separator, otherwise false