JSONObject Class

A JSON object consists key/value pairs. The string representation of a JSON object is a widely-used standard format for exchanging data. The string begins with a left brace "{" and ends with a right brace "}". Keys and values are separated by colon ":". Each key/value pair is separated by comma ",".

Constructors

JSONObject( )
JSONObject( String source )
JSONObject( javaxt.utils.Record record )
JSONObject( org.w3c.dom.Document xml )
JSONObject( org.w3c.dom.Node node )

Public Methods

get( String key ) returns JSONValue
Returns the value associated with a key.
get( String... path ) returns JSONValue
Returns a nested value associated with the given keys
set( String key, Object value ) returns void
Used to set the value for a given key.
remove( String key ) returns JSONValue
Remove a name and its value, if present. Returns the value that was associated with the name, or null if there was no value.
toString( ) returns String
Returns the JSONObject as a String. For compactness, no whitespace is added. If this would not result in a syntactically correct JSON text, then null will be returned instead.
toString( int indentFactor ) returns String
Returns a pretty-printed JSON text of this JSONObject.
indentFactorThe number of spaces to add to each level of indentation.