|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<JsonToken> com.google.gson.stream.JsonToken
public enum JsonToken
A structure, name or value type in a JSON-encoded string.
Enum Constant Summary | |
---|---|
BEGIN_ARRAY
The opening of a JSON array. |
|
BEGIN_OBJECT
The opening of a JSON object. |
|
BOOLEAN
A JSON true or false . |
|
END_ARRAY
The closing of a JSON array. |
|
END_DOCUMENT
The end of the JSON stream. |
|
END_OBJECT
The closing of a JSON object. |
|
NAME
A JSON property name. |
|
NULL
A JSON null . |
|
NUMBER
A JSON number represented in this API by a Java double , long , or int . |
|
STRING
A JSON string. |
Method Summary | |
---|---|
static JsonToken |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static JsonToken[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final JsonToken BEGIN_ARRAY
JsonWriter.beginObject()
and read using JsonReader.beginObject()
.
public static final JsonToken END_ARRAY
JsonWriter.endArray()
and read using JsonReader.endArray()
.
public static final JsonToken BEGIN_OBJECT
JsonWriter.beginObject()
and read using JsonReader.beginObject()
.
public static final JsonToken END_OBJECT
JsonWriter.endObject()
and read using JsonReader.endObject()
.
public static final JsonToken NAME
JsonWriter.name(java.lang.String)
and read using JsonReader.nextName()
public static final JsonToken STRING
public static final JsonToken NUMBER
double
, long
, or int
.
public static final JsonToken BOOLEAN
true
or false
.
public static final JsonToken NULL
null
.
public static final JsonToken END_DOCUMENT
JsonReader.peek()
to signal that the JSON-encoded value has no more
tokens.
Method Detail |
---|
public static JsonToken[] values()
for (JsonToken c : JsonToken.values()) System.out.println(c);
public static JsonToken valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |