JsonToken Data type

Version: Available or changed with runtime version 1.0.

Is a container for any well-formed JSON data. A default JsonToken object contains the JSON value of NULL.

Instance methods

The following methods are available on instances of the JsonToken data type.

Method name Description
AsArray() Converts the value in a JsonToken to a JsonArray data type.
AsObject() Converts the value in a JsonToken to a JsonObject data type.
AsValue() Converts the value in a JsonToken to a JsonValue data type.
Clone() Creates a deep-copy of the JsonToken value.
IsArray() Indicates whether a JsonToken represents a JSON array.
IsObject() Indicates whether a JsonToken contains a JSON object.
IsValue() Indicates whether a JsonToken contains a JSON value.
Path() Retrieves the JSON path of the token relative to the root of its containing tree.
ReadFrom(Text) Reads the JSON data from the string into a JsonToken variable.
ReadFrom(InStream) Reads the JSON data from the stream into a JsonToken variable.
SelectToken(Text, var JsonToken) Selects a JsonToken using a JPath expression.
WriteTo(var Text) Serializes and writes the JSON data of the JsonToken to a given Text object.
WriteTo(OutStream) Serializes and writes the JSON data of the JsonToken to a given OutStream object.

Note

For performance reasons all HTTP, JSON, TextBuilder, and XML types are reference types, not value types. Reference types holds a pointer to the data elsewhere in memory, whereas value types store its own data.

Get Started with AL
Developing Extensions