JsonToken enum

Enumerates all token types that a JsonParser can encounter during JSON parsing.

Tokens represent both structural and value-level elements within a JSON document, enabling fine-grained parsing control.

Example

if (parser.getCurrentToken() == JsonToken.VALUE_NUMBER) {
  print('Found a number: ${parser.getCurrentValue()}');
}

Categories

See also:

Inheritance
Available extensions

Values

START_OBJECT → const JsonToken

Indicates the beginning of a JSON object ({).

END_OBJECT → const JsonToken

Indicates the end of a JSON object (}).

START_ARRAY → const JsonToken

Indicates the beginning of a JSON array ([).

END_ARRAY → const JsonToken

Indicates the end of a JSON array (]).

FIELD_NAME → const JsonToken

Represents a field name within a JSON object.

VALUE_STRING → const JsonToken

Represents a string value.

VALUE_NUMBER → const JsonToken

Represents a numeric value.

VALUE_BOOLEAN → const JsonToken

Represents a boolean value (true or false).

VALUE_NULL → const JsonToken

Represents a null literal (null).

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<JsonToken>
A constant List of the values in this enum, in order of their declaration.