JSON Parser Xojo plugin |

# EinhugurJSON.JSONPrimitive Class

Basic JSON primitive that can represent Boolean, Double, Integer, a String, JSON array or JSON object.

Object
JSONPrimitive

class EinhugurJSON.JSONPrimitive

#### Constructors

JSONPrimitive | Private constructor.

#### Properties

BooleanValue | Returns the value as Boolean from the primitive
DoubleValue | Returns the value as Double from the primitive
IntegerValue | Returns the value as Integer (Int64) from the primitive
IsArray | Returns true if the primitive contains Array.
IsBoolean | Returns true if the primitive contains Boolean.
IsDouble | Returns true if the primitive contains Double.
IsFalse | Returns true if the primitive is false.
IsInteger | Returns true if the primitive contains Integer value.
IsNull | Returns true if the primitive contains null or nil.
IsNumber | Returns true if the primitive contains number (can be Integer or Double)
IsObject | Returns true if the primitive contains JSONObject (dictionary)
IsString | Returns true if the primitive contains String.
IsTrue | Returns true if the primitive is true.
NumberValue | Returns the value as Double from the primitive, reading the value either from Integer or Double, not caring which one it is.
StringValue | Returns the value as String from the primitive
Type | Returns type code for the primitive. The type code can be any value from the JSONPrimitive.NodeTypeEnum.

#### Methods

Clone | Makes a clone of the JSONPrimitive.
shared FromBoolean | Constructs JSONPrimitive from a Boolean.
shared FromDouble | Constructs JSONPrimitive from a Double.
shared FromInteger | Constructs JSONPrimitive from a Integer.
shared FromNil | Constructs JSONPrimitive from Nil.
shared FromString | Constructs JSONPrimitive from a String.
shared FromVariant | Generates JSON structure from a variant.
GetSource | Generates JSON string from the JSON object model. All parameters of this function are optional.
Operator_Compare | Comparison operator to compare two JSONPrimitives with the standard Xojo = operator.
shared Parse | Parses JSON string.
ToVariant | Attempts to convert the JSON structure to variant. Taking optional delegate to evaluate custom structures such as color and date which are not part of normal JSON standard.

#### Delegates

EvaluateStringDelegate (console safe) | Delegate to use with JSONPrimitive.ToVariant to evaluated custom structures which are not part of the JSON standard such as for example Date or Color.

#### Enumerations

NodeTypeEnum | Enum representing types of primitive nodes.

#### Supported Platforms:

- macOS Intel 32 bit
- macOS Intel 64 bit
- macOS Apple Silicon
- Windows 32 bit
- Windows 64 bit
- Windows ARM 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM 32 bit
- Linux ARM 64 bit
- iOS