Token

enum Token

A structure, name, or value type in a JSON-encoded string.

Entries

BEGIN_ARRAY
Link copied to clipboard

The opening of a JSON array. Written using beginArray and read using beginArray.

END_ARRAY
Link copied to clipboard

The closing of a JSON array. Written using endArray and read using endArray.

BEGIN_OBJECT
Link copied to clipboard

The opening of a JSON object. Written using beginObject and read using beginObject.

END_OBJECT
Link copied to clipboard

The closing of a JSON object. Written using endObject and read using endObject.

NAME
Link copied to clipboard

A JSON property name. Within objects, tokens alternate between names and their values. Written using name and read using nextName

STRING
Link copied to clipboard

A JSON string.

NUMBER
Link copied to clipboard

A JSON number represented in this API by a Java double, long, or int.

BOOLEAN
Link copied to clipboard

A JSON true or false.

NULL
Link copied to clipboard

A JSON null.

END_DOCUMENT
Link copied to clipboard

The end of the JSON stream. This sentinel value is returned by peek to signal that the JSON-encoded value has no more tokens.

Functions

describeConstable
Link copied to clipboard
abstract fun describeConstable(): Optional<out ConstantDesc>
valueOf
Link copied to clipboard
open fun valueOf(name: String): JsonReader.Token
values
Link copied to clipboard
open fun values(): Array<JsonReader.Token>