Package com.github.tnakamot.json.token
This package provides classes to represent tokens in JSON text. All types of tokens except white
spaces (ws) defined in RFC 8259 are supported.
All insignificant white spaces are simply ignored in this implementation.
All token types are defined as enums of JSONTokenType
.
JSONToken
represents one token of any type.
All structural characters ('[', ']', '{', '}', ',', ':') are represented as direct instances
of JSONToken
.
Tokens that represent primitive JSON values (string, number, boolean and null) have
corresponding child classes of JSONToken
:
- string:
JSONTokenString
- number:
JSONTokenNumber
- boolean:
JSONTokenBoolean
- null:
JSONTokenNull
Instantiation of JSONToken
and its child classes should
be done by JSON lexical analyzes. In order to support possible various implementations of JSON
lexical analyzers, all their constructors are defined as "public", but it is highly discouraged
by user programs to directly instantiate them.
- See Also:
- RFC 8259
-
Class Summary Class Description JSONToken Represents one token in JSON text.JSONTokenBoolean Represents one "boolean" type token in JSON text.JSONTokenNull Represents one "null" token in JSON text.JSONTokenNumber Represents one "number" type token in JSON text.JSONTokenString Represents one "string" type token in JSON text.StringLocation Represents a location in aString
.StringRange Represents a range in aString
. -
Enum Summary Enum Description JSONTokenType Represents a type of token in JSON text.