JsonValue Data Type

Is a container for any well-formed fundamental JSON value. A default JsonValue is set to the JSON value of NULL.

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

Method name Description
Path() Retrieves the JSON path of the value relative to its containing tree.
ReadFrom(String) Reads the JSON data into a JsonValue variable.
ReadFrom(InStream) Reads the JSON data from the stream into a JsonValue variable.
WriteTo(var Text) Serializes and writes the JSON data of the JsonValue to a given object.
WriteTo(OutStream) Serializes and writes the JSON data of the JsonValue to a given object.
SelectToken(String, var JsonToken) Selects a JsonToken using a JPath expression.
Clone() Creates a deep-copy of the JsonToken value.
AsToken() Converts the value in a JsonValue to a JsonToken data type.
IsNull() Indicates whether the JsonValue contains the JSON value of NULL.
IsUndefined() Indicates whether the JsonValue contains the JSON value of UNDEFINED.
AsBoolean() Converts the value in a JsonValue to a Boolean data type.
AsChar() Converts the value in a JsonValue to a Char data type.
AsByte() Converts the value in a JsonValue to a Byte data type.
AsOption() Converts the value in a JsonValue to an Option data type.
AsInteger() Converts the value in a JsonValue to an Integer data type.
AsBigInteger() Converts the value in a JsonValue to an BigInteger data type.
AsDecimal() Converts the value in a JsonValue to a Decimal data type.
AsDuration() Converts the value in a JsonValue to a Duration data type.
AsDate() Converts the value in a JsonValue to a Date data type.
AsTime() Converts the value in a JsonValue to a Time data type.
AsDateTime() Converts the value in a JsonValue to a DateTime data type.
AsText() Converts the value in a JsonValue to a Text data type.
AsCode() Converts the value in a JsonValue to a Code data type.
SetValue(Boolean) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Char) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Byte) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Option) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Integer) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(BigInteger) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Decimal) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Duration) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Date) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(Time) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(DateTime) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValue(String) Set the contents of the JsonValue variable to the JSON representation of the given value.
SetValueToNull() Set the contents of the JsonValue variable to the JSON representation of NULL.
SetValueToUndefined() Set the contents of the JsonValue variable to the JSON representation of UNDEFINED.

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.

See Also

Getting Started with AL
Developing Extensions