Package com.github.tnakamot.json.token
Class JSONToken
- java.lang.Object
 - 
- com.github.tnakamot.json.token.JSONToken
 
 
- 
- Direct Known Subclasses:
 JSONTokenBoolean,JSONTokenNull,JSONTokenNumber,JSONTokenString
public class JSONToken extends Object
Represents one token in JSON text.Instances of this class are immutable.
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringJSON_BEGIN_ARRAYstatic StringJSON_BEGIN_OBJECTstatic StringJSON_END_ARRAYstatic StringJSON_END_OBJECTstatic StringJSON_NAME_SEPARATORstatic StringJSON_VALUE_SEPARATOR 
- 
Constructor Summary
Constructors Constructor Description JSONToken(@NotNull JSONTokenType type, @NotNull String text, @NotNull StringLocation location, @NotNull JSONText source)Create one JSON text token.JSONToken(@NotNull JSONTokenType type, @NotNull String text, @NotNull StringLocation begin, @NotNull StringLocation end, @NotNull JSONText source)Create one JSON text token. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull StringLocationbeginningLocation()Location of the beginning of the token within the source JSON text.@NotNull StringLocationendLocation()Location of the end of the token within the source JSON text.@NotNull StringRangerange()Location of this token within the source JSON text.@NotNull JSONTextsource()Source JSON text where this token was extracted from.@NotNull Stringtext()Text representation of this token as it appears in the source JSON text.@NotNull JSONTokenTypetype()Type of this token. 
 - 
 
- 
- 
Field Detail
- 
JSON_BEGIN_ARRAY
public static final String JSON_BEGIN_ARRAY
- See Also:
 - Constant Field Values
 
 
- 
JSON_END_ARRAY
public static final String JSON_END_ARRAY
- See Also:
 - Constant Field Values
 
 
- 
JSON_BEGIN_OBJECT
public static final String JSON_BEGIN_OBJECT
- See Also:
 - Constant Field Values
 
 
- 
JSON_END_OBJECT
public static final String JSON_END_OBJECT
- See Also:
 - Constant Field Values
 
 
- 
JSON_NAME_SEPARATOR
public static final String JSON_NAME_SEPARATOR
- See Also:
 - Constant Field Values
 
 
- 
JSON_VALUE_SEPARATOR
public static final String JSON_VALUE_SEPARATOR
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
JSONToken
public JSONToken(@NotNull @NotNull JSONTokenType type, @NotNull @NotNull String text, @NotNull @NotNull StringLocation begin, @NotNull @NotNull StringLocation end, @NotNull @NotNull JSONText source)Create one JSON text token.- Parameters:
 type- type of this tokentext- text of this tokenbegin- beginning location of this token within the source JSON textend- end location of this token within the source JSON textsource- source JSON text where this token was extracted from
 
- 
JSONToken
public JSONToken(@NotNull @NotNull JSONTokenType type, @NotNull @NotNull String text, @NotNull @NotNull StringLocation location, @NotNull @NotNull JSONText source)Create one JSON text token.- Parameters:
 type- type of this tokentext- text of this tokenlocation- location of this token within the source JSON textsource- source JSON text where this token was extracted from
 
 - 
 
- 
Method Detail
- 
type
@NotNull public @NotNull JSONTokenType type()
Type of this token.- Returns:
 - type of this token
 
 
- 
text
@NotNull public @NotNull String text()
Text representation of this token as it appears in the source JSON text.- Returns:
 - text representation of this token as it appears in the source JSON text.
 
 
- 
range
@NotNull public @NotNull StringRange range()
Location of this token within the source JSON text.- Returns:
 - location of this token within the source JSON text.
 
 
- 
beginningLocation
@NotNull public @NotNull StringLocation beginningLocation()
Location of the beginning of the token within the source JSON text.- Returns:
 - location of the beginning of the token within the source JSON text.
 
 
- 
endLocation
@NotNull public @NotNull StringLocation endLocation()
Location of the end of the token within the source JSON text.- Returns:
 - location of the end of the token within the source JSON text.
 
 
- 
source
@NotNull public @NotNull JSONText source()
Source JSON text where this token was extracted from.- Returns:
 - source JSON text where this token was extracted from.
 
 
 - 
 
 -