public final class Token
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
advance() |
void |
check(TokenType expectedType)
Validate that the token is the expected type (throwing an exception if it isn't).
|
void |
checkAndAdvance(TokenType expectedType)
Validate that the token is the expected type (throwing an exception if it isn't), then advance to the next
token.
|
java.lang.String |
getDescription()
Get a user friendly description of the token.
|
java.lang.Object |
getPrimitiveValue() |
TokenType |
getType() |
static boolean |
isControlCharacter(char c)
Return true if the particular character should be considered a control character and specified via Unicode escape
sequence in JSON.
|
public Token(Reader reader)
public static boolean isControlCharacter(char c)
c
- character in questionpublic TokenType getType()
public java.lang.Object getPrimitiveValue()
public java.lang.String getDescription()
public void advance()
public void checkAndAdvance(TokenType expectedType)
expectedType
- expected token typepublic void check(TokenType expectedType)
expectedType
- expected token type