All Bundles

JsonElement

JSON value element

Operations

New

Constructor

New(type:JsonElement->JsonType)
Parameters
NameTypeDescription
typeJsonElement->JsonTypeJson element type

Constructor

New(type:JsonElement->JsonType, value:String)
Parameters
NameTypeDescription
typeJsonElement->JsonTypeJson element type
valueStringJson string value

Constructor

New(value:String)
Parameters
NameTypeDescription
valueStringJson string value

Constructor

New(value:Int)
Parameters
NameTypeDescription
valueIntJson integer value

Constructor

New(value:Float)
Parameters
NameTypeDescription
valueFloatJson float value

Constructor

New(array_elems:Vector<JsonElement>)
Parameters
NameTypeDescription
array_elemsVector<JsonElement>Json array value

Constructor

New(map_elems:Map<String,JsonElement>)
Parameters
NameTypeDescription
map_elemsMap<String,JsonElement>Json object (names/values)

Add

Adds an element

method : public : Add(elem:JsonElement) ~ Bool
Parameters
NameTypeDescription
elemJsonElementelement

Return
TypeDescription
Booltrue if successful, false otherwise

Adds a value

method : public : Add(value:String) ~ Bool
Parameters
NameTypeDescription
valueStringvalue

Return
TypeDescription
Booltrue if successful, false otherwise

Adds a value

method : public : Add(value:Int) ~ Bool
Parameters
NameTypeDescription
valueIntvalue

Return
TypeDescription
Booltrue if successful, false otherwise

Adds a value

method : public : Add(value:Float) ~ Bool
Parameters
NameTypeDescription
valueFloatvalue

Return
TypeDescription
Booltrue if successful, false otherwise

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

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

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

Inserts a value

method : public : Insert(name:String, value:String) ~ Bool
Parameters
NameTypeDescription
nameStringvalue name
valueStringvalue

Return
TypeDescription
Booltrue if successful, false otherwise

Inserts a value

method : public : Insert(name:String, value:Int) ~ Bool
Parameters
NameTypeDescription
nameStringvalue name
valueIntvalue

Return
TypeDescription
Booltrue if successful, false otherwise

Inserts a value

method : public : Insert(name:String, value:Float) ~ Bool
Parameters
NameTypeDescription
nameStringvalue name
valueFloatvalue

Return
TypeDescription
Booltrue if successful, false otherwise

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

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

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