Table of Contents

TJPrimitive Class

Represents a JSON primitive value (string, number, or Boolean).

Remarks

TJPrimitive stores a single JSON value and provides type-safe access via the AsBoolean, AsString, AsDouble, AsInteger, and AsInt64 methods. Use the IsBoolean, IsString, etc. methods to check the actual type before conversion.

Syntax

Unit: Bcl.Json.Classes

TJPrimitive = class(TJElement);

Constructors

Methods

Name Description
AsBoolean Returns the value as a Boolean. Attempts type conversion if the stored value is not Boolean.
AsDouble Returns the value as a Double. Attempts type conversion if the stored value is not Double.
AsInt64 Returns the value as an Int64. Attempts type conversion if the stored value is not Int64.
AsInteger Returns the value as an Integer. Attempts type conversion if the stored value is not Integer.
AsString Returns the value as a string.
Clone Creates a deep copy of this JSON primitive.
IsBoolean Returns True if the stored value is a Boolean.
IsDouble Returns True if the stored value is a Double.
IsInt64 Returns True if the stored value is an Int64.
IsInteger Returns True if the stored value is an Integer.
IsString Returns True if the stored value is a string.