|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gson.stream.JsonReader
com.google.gson.internal.bind.JsonTreeReader
public final class JsonTreeReader
This reader walks the elements of a JsonElement as if it was coming from a character stream.
| Constructor Summary | |
|---|---|
JsonTreeReader(JsonElement element)
|
|
| Method Summary | |
|---|---|
void |
beginArray()
Consumes the next token from the JSON stream and asserts that it is the beginning of a new array. |
void |
beginObject()
Consumes the next token from the JSON stream and asserts that it is the beginning of a new object. |
void |
close()
Closes this JSON reader and the underlying Reader. |
void |
endArray()
Consumes the next token from the JSON stream and asserts that it is the end of the current array. |
void |
endObject()
Consumes the next token from the JSON stream and asserts that it is the end of the current object. |
boolean |
hasNext()
Returns true if the current array or object has another element. |
boolean |
nextBoolean()
Returns the boolean value of the next token,
consuming it. |
double |
nextDouble()
Returns the double value of the next token,
consuming it. |
int |
nextInt()
Returns the int value of the next token,
consuming it. |
long |
nextLong()
Returns the long value of the next token,
consuming it. |
String |
nextName()
Returns the next token, a property name, and
consumes it. |
void |
nextNull()
Consumes the next token from the JSON stream and asserts that it is a literal null. |
String |
nextString()
Returns the string value of the next token,
consuming it. |
JsonToken |
peek()
Returns the type of the next token without consuming it. |
void |
promoteNameToValue()
|
void |
skipValue()
Skips the next value recursively. |
String |
toString()
|
| Methods inherited from class com.google.gson.stream.JsonReader |
|---|
isLenient, setLenient |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JsonTreeReader(JsonElement element)
| Method Detail |
|---|
public void beginArray()
throws IOException
JsonReader
beginArray in class JsonReaderIOException
public void endArray()
throws IOException
JsonReader
endArray in class JsonReaderIOException
public void beginObject()
throws IOException
JsonReader
beginObject in class JsonReaderIOException
public void endObject()
throws IOException
JsonReader
endObject in class JsonReaderIOException
public boolean hasNext()
throws IOException
JsonReader
hasNext in class JsonReaderIOException
public JsonToken peek()
throws IOException
JsonReader
peek in class JsonReaderIOException
public String nextName()
throws IOException
JsonReaderproperty name, and
consumes it.
nextName in class JsonReaderIOException - if the next token in the stream is not a property
name.
public String nextString()
throws IOException
JsonReaderstring value of the next token,
consuming it. If the next token is a number, this method will return its
string form.
nextString in class JsonReaderIOException
public boolean nextBoolean()
throws IOException
JsonReaderboolean value of the next token,
consuming it.
nextBoolean in class JsonReaderIOException
public void nextNull()
throws IOException
JsonReader
nextNull in class JsonReaderIOException
public double nextDouble()
throws IOException
JsonReaderdouble value of the next token,
consuming it. If the next token is a string, this method will attempt to
parse it as a double using Double.parseDouble(String).
nextDouble in class JsonReaderIOException
public long nextLong()
throws IOException
JsonReaderlong value of the next token,
consuming it. If the next token is a string, this method will attempt to
parse it as a long. If the next token's numeric value cannot be exactly
represented by a Java long, this method throws.
nextLong in class JsonReaderIOException
public int nextInt()
throws IOException
JsonReaderint value of the next token,
consuming it. If the next token is a string, this method will attempt to
parse it as an int. If the next token's numeric value cannot be exactly
represented by a Java int, this method throws.
nextInt in class JsonReaderIOException
public void close()
throws IOException
JsonReaderReader.
close in interface Closeableclose in class JsonReaderIOException
public void skipValue()
throws IOException
JsonReader
skipValue in class JsonReaderIOExceptionpublic String toString()
toString in class JsonReader
public void promoteNameToValue()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||