public final class JsonReader
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonReader.Type
The type of value that the
JsonReader is positioned over. |
| Modifier and Type | Method and Description |
|---|---|
void |
array()
Starts reading an array at the current value.
|
boolean |
bool()
Parses the current value as a boolean.
|
JsonReader.Type |
current()
Returns the current type of the value.
|
double |
doubleVal()
Parses the current value as a double.
|
float |
floatVal()
Parses the current value as a float.
|
static JsonReader |
from(java.io.InputStream in)
Create a
JsonReader from an InputStream. |
static JsonReader |
from(java.io.Reader in)
Create a
JsonReader from an Reader. |
static JsonReader |
from(java.lang.String s)
Create a
JsonReader from a String. |
int |
intVal()
Parses the current value as an integer.
|
java.lang.String |
key()
Reads the key for the object at the current value.
|
long |
longVal()
Parses the current value as a long.
|
boolean |
next()
Advance to the next value in this array or object.
|
void |
nul()
Parses the current value as a null.
|
java.lang.Number |
number()
Parses the current value as a
Number. |
void |
object()
Starts reading an object at the current value.
|
boolean |
pop()
Returns to the array or object structure above the current one, and
advances to the next key or value.
|
java.lang.String |
string()
Parses the current value as a string.
|
java.lang.Object |
value()
Returns the current value.
|
public static JsonReader from(java.io.Reader in) throws JsonParserException
JsonReader from an Reader.JsonParserExceptionpublic static JsonReader from(java.io.InputStream in) throws JsonParserException
JsonReader from an InputStream.JsonParserExceptionpublic static JsonReader from(java.lang.String s) throws JsonParserException
JsonReader from a String.JsonParserExceptionpublic boolean pop()
throws JsonParserException
JsonParserExceptionpublic JsonReader.Type current() throws JsonParserException
JsonParserExceptionpublic void object()
throws JsonParserException
JsonParserExceptionpublic java.lang.String key()
throws JsonParserException
JsonParserExceptionpublic void array()
throws JsonParserException
JsonParserExceptionpublic java.lang.Object value()
throws JsonParserException
JsonParserExceptionpublic void nul()
throws JsonParserException
JsonParserExceptionpublic java.lang.String string()
throws JsonParserException
JsonParserExceptionpublic boolean bool()
throws JsonParserException
JsonParserExceptionpublic java.lang.Number number()
throws JsonParserException
Number.JsonParserExceptionpublic long longVal()
throws JsonParserException
JsonParserExceptionpublic int intVal()
throws JsonParserException
JsonParserExceptionpublic float floatVal()
throws JsonParserException
JsonParserExceptionpublic double doubleVal()
throws JsonParserException
JsonParserExceptionpublic boolean next()
throws JsonParserException
JsonParserException