Modifier and Type | Method and Description |
---|---|
boolean |
endArray()
Return
true if the next token is the end of an array (']'). |
boolean |
endObject()
Return
true if the next token is the end of an object ('}'). |
static JsonTokenStream |
fromStream(CharStream stream)
Return a new token stream taking input from
stream . |
static JsonTokenStream |
fromString(java.lang.String text)
Return a new token stream taking input from
text . |
boolean |
nextIs(int type)
Return
true if the next token has the specfied type. |
JsonToken |
peek()
Return the next token, which is not consumed.
|
JsonToken |
read()
Return the next token, which is consumed.
|
void |
undoRead(JsonToken token)
Undo the last token read, so it can be read again.
|
public boolean endArray()
Return true
if the next token is the end of an array (']').
true
if the next token is the end of an array (']').public boolean endObject()
Return true
if the next token is the end of an object ('}').
true
if the next token is the end of an object ('}').public static JsonTokenStream fromStream(CharStream stream)
Return a new token stream taking input from stream
.
stream
- Input stream.stream
.public static JsonTokenStream fromString(java.lang.String text)
Return a new token stream taking input from text
.
text
- Input text.text
.public boolean nextIs(int type)
Return true
if the next token has the specfied type.
type
- Token type.public JsonToken peek()
Return the next token, which is not consumed. Or a token with type JsonToken.END_STREAM at end of stream.
public JsonToken read()
Return the next token, which is consumed. Or a token with type JsonToken.END_STREAM at end of stream.
public void undoRead(JsonToken token)
Undo the last token read, so it can be read again. Only one token can be unread.
token
- The token to be read again.