JSONValue Class

Used to represent a value associated with a key in a JSONObject or an entry in a JSONArray. The value can be converted into a number of Java primatives (strings, integers, doubles, booleans, etc).

Constructors

public JSONValue( Object value )

Methods

get( int i ) returns javaxt.json.JSONValue
Returns the value associated with an index in a JSONArray, assuming the underlying object represented by this class is a JSONArray. This is shorthand for value.toJSONArray().get(i);
get( String key ) returns javaxt.json.JSONValue
Returns the value associated with a key in a JSONObject, assuming the underlying object represented by this class is a JSONObject. This is shorthand for value.toJSONObject().get(key);
toJSONArray( ) returns javaxt.json.JSONArray
Returns the value as a JSONArray. Returns a null if there was a problem converting the value to an JSONArray or if the value is null.
toJSONObject( ) returns javaxt.json.JSONObject
Returns the value as a JSONObject. Returns a null if there was a problem converting the value to an JSONObject or if the value is null.