public interface CharacterSource
Character cursor abstraction used by the streaming JSON parsers.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
consumeIfMatch(char[] match)Useful for finding constants in a string like true, false, etc. |
|
public int |
currentChar()returns the current character without changing the IO pointer or index. |
|
public String |
errorDetails(String message)Builds an error message using the current source position. |
|
public char[] |
findNextChar(int ch, int esc)Used to find strings and their ilk Finds the next non-escaped char |
|
public boolean |
hadEscape()Reports whether the last string scan encountered an escape sequence. |
|
public boolean |
hasChar()Checks to see if there is a next character. |
|
public int |
location()This is mostly for debugging and testing. |
|
public int |
nextChar()returns the next character moving the file pointer or index to the next location. |
|
public char[] |
readNumber()Reads a number from the character source. |
|
public int |
safeNextChar()Combines the operations of nextChar and hasChar. |
|
public void |
skipWhiteSpace()Skip white space. |
Useful for finding constants in a string like true, false, etc.
returns the current character without changing the IO pointer or index.
Builds an error message using the current source position.
message - parser-specific messageUsed to find strings and their ilk Finds the next non-escaped char
ch - character to findesc - escape character to avoid next char if escapedReports whether the last string scan encountered an escape sequence.
true when an escape was seenChecks to see if there is a next character.
This is mostly for debugging and testing.
returns the next character moving the file pointer or index to the next location.
Reads a number from the character source.
Combines the operations of nextChar and hasChar. Characters is -1 if not found which signifies end of file. This might be preferable to avoid two method calls.
Skip white space.