Overview

Represents a JSON Object

Attribute Summary

nametypedescription
Public
mapMap

Holds a map of the pairs based on the pair name

pairsPair[]

Holds the pairs for this JSONObject

Protected

Inherited Attributes

javafx.json.JSONBase

publicnametype
doIndentBoolean

indicates whether or not indenting should be used when printing or serializing.

indentInteger

Holds the number of spaces for indenting when printing or serializing.

Function Summary

public addArray(name: String, value: Object, ) : Void

Add a JSON array to this JSONObject

public addNullPair(name: String, ) : Void

Add a Null to this JSONObject

public addPair(name: String, value: Object, ) : Void

Add a new pair to this JSONObject

public getArray(name: String, ) : <any>[]

Get an array from a pair

public getPair(name: String, ) : Pair

Get a pair

public getValue(name: String, ) : Object

Get a value from a pair

public isArray(name: String, ) : Boolean

Determine whether a pair is a JSON array or not

public removePair(name: String, ) : Void

Remove a pair from this JSON Object

protected serialize(writer: Writer, curIndent: Integer, indentAmount: Integer, ) : Void

Convert the JSON Object to JSON format.

Inherited Functions

javafx.json.JSONBase

public serialize(writer: Writer, ) : Void

Convert the JSON Object to JSON format.

protected abstract serialize(writer: Writer, curIndent: Integer, indentAmount: Integer, ) : Void

Convert the JSON Object to JSON format.

public toString() : String

Convert the JSON Object to JSON format.

Attributes

public map: Map

Holds a map of the pairs based on the pair name

public pairs: Pair[]

Holds the pairs for this JSONObject

Functions

public addArray(name: String, value: Object, ):Void

Parameters
name
the name of the pair
value
the array

Add a JSON array to this JSONObject

public addNullPair(name: String, ):Void

Parameters
name
the name of the pair

Add a Null to this JSONObject

public addPair(name: String, value: Object, ):Void

Parameters
name
the name of the pair
value
the value for the pair

Add a new pair to this JSONObject

public getArray(name: String, ):<any>[]

Parameters
name
the name of the pair
Returns
<any>[]
the array or null if not found

Get an array from a pair

public getPair(name: String, ):Pair

Parameters
name
the name of the pair
Returns
Pair
the pair or null if not found

Get a pair

public getValue(name: String, ):Object

Parameters
name
the name of the pair
Returns
Object
the value or null if not found

Get a value from a pair

public isArray(name: String, ):Boolean

Parameters
name
the name of the pair
Returns
Boolean
true if the pair contains an array, false if not

Determine whether a pair is a JSON array or not

public removePair(name: String, ):Void

Parameters
name
the name of the pair

Remove a pair from this JSON Object

protected serialize(writer: Writer, curIndent: Integer, indentAmount: Integer, ):Void

Parameters
writer
the java.io.Writer that will receive the formated JSON stream.
curIndent
the current indent amount
indentAmount
the amount to indent from the curIndent for the next indent level

Convert the JSON Object to JSON format. Output is written to the Writer.