Table of Contents

TJElement Class

Abstract base class for all JSON elements in the JSON Document Object Model.

Remarks

TJElement serves as the root of the JSON DOM class hierarchy. It provides type checking methods (IsArray, IsObject, etc.), type casting methods (AsArray, AsObject, etc.), and value access methods (AsBoolean, AsString, etc.) for working with JSON elements in a type-safe manner. Concrete subclasses include TJArray, TJObject, TJPrimitive, and TJNull.

Syntax

Unit: Bcl.Json.Classes

TJElement = class(TObject);

Methods

Name Description
AsArray Casts this element to TJArray.
AsBoolean Returns the value of this element as a Boolean.
AsDouble Returns the value of this element as a Double.
AsInt64 Returns the value of this element as an Int64.
AsInteger Returns the value of this element as an Integer.
AsNull Casts this element to TJNull.
AsObject Casts this element to TJObject.
AsPrimitive Casts this element to TJPrimitive.
AsString Returns the value of this element as a string.
Clone Creates a deep copy of this JSON element.
FromJSONValue Creates a TJElement from a System.Json.TJSONValue instance.
IsArray Returns True if this element is a TJArray.
IsBoolean Returns True if this element holds a Boolean value.
IsDouble Returns True if this element holds a Double value.
IsInt64 Returns True if this element holds an Int64 value.
IsInteger Returns True if this element holds an Integer value.
IsNull Returns True if this element is a TJNull.
IsObject Returns True if this element is a TJObject.
IsPrimitive Returns True if this element is a TJPrimitive.
IsString Returns True if this element holds a string value.
ToJSONValue Converts this JSON element to a System.Json.TJSONValue instance.