public class JSONReader
extends java.lang.Object
InputStream and extracts characters and tokens from it.| Modifier and Type | Field and Description |
|---|---|
static java.lang.Object |
NULL
It is sometimes more convenient and less ambiguous to have a
NULL object than to use Java's
null value. |
| Constructor and Description |
|---|
JSONReader(java.io.InputStream is)
Construct a JSONReader from an
InputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
arrayEnd()
End an array.
|
void |
arrayStart()
Start an array.
|
void |
mapEnd()
End a map.
|
void |
mapStart()
Start a map.
|
java.lang.String |
nextKey()
Get the next key as String.
|
java.lang.Object |
nextValue()
Get the next value.
|
char |
peek()
Get the first character of the next token.
|
public static final java.lang.Object NULL
NULL object than to use Java's
null value. NULL.equals(null) returns true.
NULL.toString() returns "null".public JSONReader(java.io.InputStream is)
InputStream.is - the InputStream.public char peek()
throws JSONException
0 on EOF.JSONException - on I/O errorpublic java.lang.String nextKey()
throws JSONException
JSONException - If syntax error.public void arrayStart()
throws JSONException
JSONException - If syntax error.public void arrayEnd()
throws JSONException
JSONException - If syntax error.public void mapStart()
throws JSONException
JSONException - If syntax error.public void mapEnd()
throws JSONException
JSONException - If syntax error.public java.lang.Object nextValue()
throws JSONException
Null object.JSONException - If syntax error.