v2025.6.2
All Bundles

JsonElement

JSON value element

Operations

Add

Adds an element

method : public : Add(elem:JsonElement) ~ Bool

Parameters

NameTypeDescription
elemJsonElementelement

Return

TypeDescription
Booltrue if successful, false otherwise

Add

Adds a value

method : public : Add(value:String) ~ Bool

Parameters

NameTypeDescription
valueStringvalue

Return

TypeDescription
Booltrue if successful, false otherwise

Add

Adds a value

method : public : Add(value:Int) ~ Bool

Parameters

NameTypeDescription
valueIntvalue

Return

TypeDescription
Booltrue if successful, false otherwise

Add

Adds a value

method : public : Add(value:Float) ~ Bool

Parameters

NameTypeDescription
valueFloatvalue

Return

TypeDescription
Booltrue if successful, false otherwise

Add

Adds a value

method : public : Add(value:Bool) ~ Bool

Parameters

NameTypeDescription
valueBoolvalue

Return

TypeDescription
Booltrue if successful, false otherwise

AddChild

Adds a class child node

method : public : AddChild(name:String) ~ JsonElement

Parameters

NameTypeDescription
nameStringclass name

Return

TypeDescription
JsonElementchild class

Decode

General decoding for Json strings

function : native : Decode(str:String) ~ String

Parameters

NameTypeDescription
strStringencoded string

Return

TypeDescription
Stringdecoded string

Encode

General encoding for JSON strings

function : native : Encode(str:String) ~ String

Parameters

NameTypeDescription
strStringdecoded string

Return

TypeDescription
Stringencoding string

FindElements

Queries the object graph. Object attributes referenced by '/' while array elements are referenced by '[index]'. Example "cars/[last]/make".

method : public : FindElements(path:String) ~ JsonElement

Parameters

NameTypeDescription
pathStringquery path

Return

TypeDescription
JsonElementmatching element

Get

Gets an indexed value from an array type

method : public : Get(index:Int) ~ JsonElement

Parameters

NameTypeDescription
indexIntindex

Return

TypeDescription
JsonElementindexed value

Get

Gets a named value from an object type

method : public : Get(name:String) ~ JsonElement

Parameters

NameTypeDescription
nameStringelement name

Return

TypeDescription
JsonElementelement value

GetBool

Gets the float value

method : public : GetBool() ~ Bool

Return

TypeDescription
Boolfloat value

GetFloat

Gets the float value

method : public : GetFloat() ~ Float

Return

TypeDescription
Floatfloat value

GetInt

Gets the integer value

method : public : GetInt() ~ Int

Return

TypeDescription
Intinteger value

GetNames

Gets the names of object attributes

method : public : GetNames() ~ Vector<String>

Return

TypeDescription
Vector<String>object attribute names

GetString

Gets the string value

method : public : GetString() ~ String

Return

TypeDescription
Stringstring value

GetType

Gets the type

method : public : GetType() ~ JsonElement->JsonType

Return

TypeDescription
JsonElement->JsonTypetype

GetValue

Gets the string value

method : public : GetValue() ~ String

Return

TypeDescription
Stringstring value

Has

Check to see if the indexed value exists

method : public : Has(index:Int) ~ Bool

Parameters

NameTypeDescription
indexIntindex

Return

TypeDescription
Booltrue if exists, false otherwise

Has

Check to see if the indexed value exists

method : public : Has(name:String) ~ Bool

Parameters

NameTypeDescription
nameStringelement name

Return

TypeDescription
Booltrue if exists, false otherwise

Insert

Insert an element

method : public : Insert(name:String, elem:JsonElement) ~ Bool

Parameters

NameTypeDescription
nameStringelement name
elemJsonElementelement

Return

TypeDescription
Booltrue if successful, false otherwise

Insert

Inserts a value

method : public : Insert(name:String, value:String) ~ Bool

Parameters

NameTypeDescription
nameStringvalue name
valueStringvalue

Return

TypeDescription
Booltrue if successful, false otherwise

Insert

Inserts a value

method : public : Insert(name:String, value:Int) ~ Bool

Parameters

NameTypeDescription
nameStringvalue name
valueIntvalue

Return

TypeDescription
Booltrue if successful, false otherwise

Insert

Inserts a value

method : public : Insert(name:String, value:Float) ~ Bool

Parameters

NameTypeDescription
nameStringvalue name
valueFloatvalue

Return

TypeDescription
Booltrue if successful, false otherwise

Insert

Inserts a value

method : public : Insert(name:String, value:Bool) ~ Bool

Parameters

NameTypeDescription
nameStringvalue name
valueBoolvalue

Return

TypeDescription
Booltrue if successful, false otherwise

IsNull

Checks for 'null' JSON value

method : public : IsNull() ~ Bool

Return

TypeDescription
Booltrue if 'null', false otherwise

IsNull

Checks for 'null' JSON value

function : IsNull(elem:JsonElement) ~ Bool

Parameters

NameTypeDescription
elemJsonElementelement to check

Return

TypeDescription
Booltrue if 'null', false otherwise

MatchType

Checks a node's type

function : MatchType(elem:JsonElement, type:JsonElement->JsonType) ~ Bool

Parameters

NameTypeDescription
elemJsonElementelement to check
typeJsonElement->JsonTypetype to check

Return

TypeDescription
Booltrue of matching, false otherwise

MatchValue

Checks a node's type

function : MatchValue(elem:JsonElement, value:String) ~ Bool

Parameters

NameTypeDescription
elemJsonElementelement to check
valueStringvalue to check

Return

TypeDescription
Booltrue of matching, false otherwise

New

Constructor

New(type:JsonElement->JsonType)

Parameters

NameTypeDescription
typeJsonElement->JsonTypeJson element type

New

Constructor

New(type:JsonElement->JsonType, value:String)

Parameters

NameTypeDescription
typeJsonElement->JsonTypeJson element type
valueStringJson string value

New

Constructor

New(value:String)

Parameters

NameTypeDescription
valueStringJson string value

New

Constructor

New(value:Int)

Parameters

NameTypeDescription
valueIntJson integer value

New

Constructor

New(value:Float)

Parameters

NameTypeDescription
valueFloatJson float value

New

Constructor

New(array_elems:Vector<JsonElement>)

Parameters

NameTypeDescription
array_elemsVector<JsonElement>Json array value

New

Constructor

New(map_elems:Map<String,JsonElement>)

Parameters

NameTypeDescription
map_elemsMap<String,JsonElement>Json object (names/values)

Size

Gets the size of an array or object value

method : public : Size() ~ Int

Return

TypeDescription
Intsize of an array or object value

ToFormattedString

Stringify and format the JSON element

method : public : ToFormattedString() ~ String

Return

TypeDescription
Stringformatted JSON string

ToString

Stringify the JSON element

method : public : ToString() ~ String

Return

TypeDescription
StringJSON string