Constructors
JSONBuilder()
Methods
addBoolean(String,Bool)
Adds a boolean value to the current scope.If the current scope is an object, you must supply a key. If the current scope is an array, key must be empty.
addFloat(String)
Adds a float value to the current scope.If the current scope is an object, you must supply a key. If the current scope is an array, key must be empty.
addInteger(String,Integer)
Adds an integer value to the current scope.If the current scope is an object, you must supply a key. If the current scope is an array, key must be empty.
addString(String,String)
Adds a string value to the current scope.If the current scope is an object, you must supply a key. If the current scope is an array, key must be empty. The value does not need to be escaped, it will be escaped by JSONBuilder.
finalize()
Pops all levels out to the root.You can call this function instead of multiple popLevel() if you are at then end of your structure.
getString()
Returns the JSON-formatted string that has been built by all push and add methods.popLevel()
Pops a level (closes an array or an object) in the JSONBuilder.Look at the root example for this class.
pushArray(String)
Adds an array to the JSONBuilder. Subsequent methods will add members inside the array.Normally, an array will be named (because it will be a named variable in the parent scope), except for when the array is the root of the JSON structure.
pushObject(String)
Adds an object to the JSONBuilder. Subsequent methods will add members inside the object.Normally, an object will be named (because it will be a named variable in the parent scope), except for when the object is the root of the JSON structure.