Stay organized with collections
Save and categorize content based on your preferences.
JsonToken
class JsonToken
A structure, name or value type in a JSON-encoded string.
Summary
Enum values |
The opening of a JSON array.
|
The opening of a JSON object.
|
A JSON true or false .
|
The closing of a JSON array.
|
The end of the JSON stream.
|
The closing of a JSON object.
|
A JSON property name.
|
A JSON null .
|
A JSON number represented in this API by a Java double , long , or int .
|
A JSON string.
|
Enum values
BOOLEAN
enum val BOOLEAN : JsonToken
A JSON true
or false
.
END_DOCUMENT
enum val END_DOCUMENT : JsonToken
The end of the JSON stream. This sentinel value is returned by android.util.JsonReader#peek()
to signal that the JSON-encoded value has no more tokens.
NUMBER
enum val NUMBER : JsonToken
A JSON number represented in this API by a Java double
, long
, or int
.
STRING
enum val STRING : JsonToken
A JSON string.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# JsonToken\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nJsonToken\n=========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/util/JsonToken \"View this page in Java\") \n\n```\nclass JsonToken\n```\n\n|---|---|-----------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[android.util.JsonToken](#)\\\u003e ||\n| | ↳ | [android.util.JsonToken](#) |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [JsonToken.BEGIN_ARRAY](#ENUM_VALUE:BEGIN_ARRAY), [JsonToken.BEGIN_OBJECT](#ENUM_VALUE:BEGIN_OBJECT), [JsonToken.BOOLEAN](#ENUM_VALUE:BOOLEAN), [JsonToken.END_ARRAY](#ENUM_VALUE:END_ARRAY), [JsonToken.END_DOCUMENT](#ENUM_VALUE:END_DOCUMENT), [JsonToken.END_OBJECT](#ENUM_VALUE:END_OBJECT), [JsonToken.NAME](#ENUM_VALUE:NAME), [JsonToken.NULL](#ENUM_VALUE:NULL), [JsonToken.NUMBER](#ENUM_VALUE:NUMBER), [JsonToken.STRING](#ENUM_VALUE:STRING) |----------------------------------------------------|-----------------------------------------------------------------------------| | [JsonToken.BEGIN_ARRAY](#ENUM_VALUE:BEGIN_ARRAY) | The opening of a JSON array. | | [JsonToken.BEGIN_OBJECT](#ENUM_VALUE:BEGIN_OBJECT) | The opening of a JSON object. | | [JsonToken.BOOLEAN](#ENUM_VALUE:BOOLEAN) | A JSON `true` or `false`. | | [JsonToken.END_ARRAY](#ENUM_VALUE:END_ARRAY) | The closing of a JSON array. | | [JsonToken.END_DOCUMENT](#ENUM_VALUE:END_DOCUMENT) | The end of the JSON stream. | | [JsonToken.END_OBJECT](#ENUM_VALUE:END_OBJECT) | The closing of a JSON object. | | [JsonToken.NAME](#ENUM_VALUE:NAME) | A JSON property name. | | [JsonToken.NULL](#ENUM_VALUE:NULL) | A JSON `null`. | | [JsonToken.NUMBER](#ENUM_VALUE:NUMBER) | A JSON number represented in this API by a Java `double`, `long`, or `int`. | | [JsonToken.STRING](#ENUM_VALUE:STRING) | A JSON string. | |\n\nA structure, name or value type in a JSON-encoded string.\n\nSummary\n-------\n\n| Enum values ||\n|----------------------------------------------------------------------------------------------------------|---|\n| [BEGIN_ARRAY](#ENUM_VALUE:BEGIN_ARRAY) The opening of a JSON array. |\n| [BEGIN_OBJECT](#ENUM_VALUE:BEGIN_OBJECT) The opening of a JSON object. |\n| [BOOLEAN](#ENUM_VALUE:BOOLEAN) A JSON `true` or `false`. |\n| [END_ARRAY](#ENUM_VALUE:END_ARRAY) The closing of a JSON array. |\n| [END_DOCUMENT](#ENUM_VALUE:END_DOCUMENT) The end of the JSON stream. |\n| [END_OBJECT](#ENUM_VALUE:END_OBJECT) The closing of a JSON object. |\n| [NAME](#ENUM_VALUE:NAME) A JSON property name. |\n| [NULL](#ENUM_VALUE:NULL) A JSON `null`. |\n| [NUMBER](#ENUM_VALUE:NUMBER) A JSON number represented in this API by a Java `double`, `long`, or `int`. |\n| [STRING](#ENUM_VALUE:STRING) A JSON string. |\n\nEnum values\n-----------\n\n### BEGIN_ARRAY\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val BEGIN_ARRAY : JsonToken\n```\n\nThe opening of a JSON array. Written using [JsonWriter.beginObject](/reference/kotlin/android/util/JsonWriter#beginObject()) and read using [JsonReader.beginObject](/reference/kotlin/android/util/JsonReader#beginObject()). \n\n### BEGIN_OBJECT\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val BEGIN_OBJECT : JsonToken\n```\n\nThe opening of a JSON object. Written using [JsonWriter.beginObject](/reference/kotlin/android/util/JsonWriter#beginObject()) and read using [JsonReader.beginObject](/reference/kotlin/android/util/JsonReader#beginObject()). \n\n### BOOLEAN\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val BOOLEAN : JsonToken\n```\n\nA JSON `true` or `false`. \n\n### END_ARRAY\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val END_ARRAY : JsonToken\n```\n\nThe closing of a JSON array. Written using [JsonWriter.endArray](/reference/kotlin/android/util/JsonWriter#endArray()) and read using [JsonReader.endArray](/reference/kotlin/android/util/JsonReader#endArray()). \n\n### END_DOCUMENT\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val END_DOCUMENT : JsonToken\n```\n\nThe end of the JSON stream. This sentinel value is returned by [android.util.JsonReader#peek()](/reference/kotlin/android/util/JsonReader#peek()) to signal that the JSON-encoded value has no more tokens. \n\n### END_OBJECT\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val END_OBJECT : JsonToken\n```\n\nThe closing of a JSON object. Written using [JsonWriter.endObject](/reference/kotlin/android/util/JsonWriter#endObject()) and read using [JsonReader.endObject](/reference/kotlin/android/util/JsonReader#endObject()). \n\n### NAME\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val NAME : JsonToken\n```\n\nA JSON property name. Within objects, tokens alternate between names and their values. Written using [JsonWriter.name](/reference/kotlin/android/util/JsonWriter#name(kotlin.String)) and read using [android.util.JsonReader#nextName](/reference/kotlin/android/util/JsonReader#nextName()) \n\n### NULL\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val NULL : JsonToken\n```\n\nA JSON `null`. \n\n### NUMBER\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val NUMBER : JsonToken\n```\n\nA JSON number represented in this API by a Java `double`, `long`, or `int`. \n\n### STRING\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val STRING : JsonToken\n```\n\nA JSON string."]]