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

JSONPrimitivePrivate constructor.

Properties

BooleanValueReturns the value as Boolean from the primitive
DoubleValueReturns the value as Double from the primitive
IntegerValueReturns the value as Integer (Int64) from the primitive
IsArrayReturns true if the primitive contains Array.
IsBooleanReturns true if the primitive contains Boolean.
IsDoubleReturns true if the primitive contains Double.
IsFalseReturns true if the primitive is false.
IsIntegerReturns true if the primitive contains Integer value.
IsNullReturns true if the primitive contains null or nil.
IsNumberReturns true if the primitive contains number (can be Integer or Double)
IsObjectReturns true if the primitive contains JSONObject (dictionary)
IsStringReturns true if the primitive contains String.
IsTrueReturns true if the primitive is true.
NumberValueReturns the value as Double from the primitive, reading the value either from Integer or Double, not caring which one it is.
StringValueReturns the value as String from the primitive
TypeReturns type code for the primitive. The type code can be any value from the JSONPrimitive.NodeTypeEnum.

Methods

CloneMakes a clone of the JSONPrimitive.
shared FromBooleanConstructs JSONPrimitive from a Boolean.
shared FromDoubleConstructs JSONPrimitive from a Double.
shared FromIntegerConstructs JSONPrimitive from a Integer.
shared FromNilConstructs JSONPrimitive from Nil.
shared FromStringConstructs JSONPrimitive from a String.
shared FromVariantGenerates JSON structure from a variant.
GetSourceGenerates JSON string from the JSON object model. All parameters of this function are optional.
Operator_CompareComparison operator to compare two JSONPrimitives with the standard Xojo = operator.
shared ParseParses JSON string.
ToVariantAttempts 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

NodeTypeEnumEnum 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