JSONTokener class

Constructors

JSONTokener(String input)
@param in JSON encoded string. Null is not permitted and will yield a tokener that throws {@code NullPointerExceptions} when methods are called.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
input String
The input JSON.
read / write
pos int
The index of the next character to be returned by {@link #next}. When the input is exhausted, this equals the input's length.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

nextCleanInternal() int
nextString(String quote) String
Returns the string up to but not including {@code quote}, unescaping any character escape sequences encountered along the way. The opening quote should have already been read. This consumes the closing quote, but does not include it in the returned string. [...]
nextToInternal(String excluded) String
Returns the string up to but not including any of the given characters or a newline character. This does not consume the excluded character.
nextValue() Object
Returns the next value from the input. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
readArray() JSONArray
Reads a sequence of values and the trailing closing brace ']' of an array. The opening brace '[' should have already been read. Note that "[]" yields an empty array, but "," returns a two-element array equivalent to "null,null".
readEscapeCharacter() String
Unescapes the character identified by the character or characters that immediately follow a backslash. The backslash '' should have already been read. This supports both unicode escapes "u000A" and two-character escapes "\n".
readLiteral() Object
Reads a null, boolean, numeric or unquoted string literal value. Numeric values will be returned as an Integer, Long, or Double, in that order of preference.
readObject() JSONObject
Reads a sequence of key/value pairs and the trailing closing brace '}' of an object. The opening brace '{' should have already been read.
skipToEndOfLine() → void
Advances the position until after the next newline character. If the line is terminated by "\r\n", the '\n' must be consumed as whitespace by the caller.
syntaxError(String message) EasyJSONException
Returns an exception containing the given message plus the current position and the entire input string.
toString() String
Returns the current position and the entire input string.
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

dehexchar(String hexStr) int
Returns the integer 0..15 value for the given hex character, or -1 for non-hex or invalid input. [...]