|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface JSONValue
| Field Summary | |
|---|---|
static JSONBoolean |
FALSE
This is a public shared instance that should be used for JSON false. |
static JSONNull |
NULL
This is a public shared instance that should be used for JSON null. |
static JSONBoolean |
TRUE
This is a public shared instance that should be used for JSON true. |
static int |
TYPE_ARRAY
The type constant for arrays. |
static int |
TYPE_BOOLEAN
The type constant for boolean values. |
static int |
TYPE_NULL
The constant indicating null. |
static int |
TYPE_NUMBER
The type constant for numbers. |
static int |
TYPE_OBJECT
The type constant for objects. |
static int |
TYPE_STRING
The type constant for strings. |
| Method Summary | |
|---|---|
JSONArray |
asJSONArray()
This method tries to convert this JSONValue into a JSONArray. |
JSONBoolean |
asJSONBoolean()
This method tries to convert this JSONValue into a JSONBoolean. |
JSONNumber |
asJSONNumber()
This method tries to convert this JSONValue into a JSONNumber. |
JSONObject |
asJSONObject()
This method tries to convert this JSONValue into a JSONObject. |
JSONString |
asJSONString()
This method tries to convert this JSONValue into a JSONString. |
java.util.List<JSONValue> |
getArray()
Get the array value as a List from this JSON value. |
java.lang.Boolean |
getBoolean()
Get the boolean from this JSON value. |
java.lang.Number |
getNumber()
Get the number from this JSON value. |
java.util.Map<java.lang.String,JSONValue> |
getObject()
Get the object value as a Map from this JSON value. |
java.lang.String |
getString()
Get the string from this JSON value. |
boolean |
isArray()
This method indicates if this JSON value is an array. |
boolean |
isBoolean()
This method indicates if this JSON value is a boolean. |
boolean |
isNull()
This method indicates if this is JSON NULL. |
boolean |
isNumber()
This method indicates if this JSON value is a number. |
boolean |
isObject()
This method indicates if this JSON value is an object. |
boolean |
isString()
This method indicates if this JSON value is a string. |
java.lang.String |
toJSONString()
Converts this JSON value into a valid JSON string. |
void |
write(java.io.Writer writer)
This method MUST write a valid JSON value to the passed writer. |
| Field Detail |
|---|
static final JSONNull NULL
static final JSONBoolean TRUE
static final JSONBoolean FALSE
static final int TYPE_NULL
static final int TYPE_NUMBER
static final int TYPE_BOOLEAN
static final int TYPE_STRING
static final int TYPE_ARRAY
static final int TYPE_OBJECT
| Method Detail |
|---|
boolean isNull()
boolean isNumber()
boolean isBoolean()
boolean isString()
boolean isArray()
boolean isObject()
java.lang.Number getNumber()
throws JSONException
JSONException - If this value does not represent a number.
java.lang.Boolean getBoolean()
throws JSONException
JSONException - If this value does not represent a boolean value.
java.lang.String getString()
throws JSONException
JSONException - If this value does not represent a string.
java.util.List<JSONValue> getArray()
throws JSONException
JSONException - If this value does not represent an array.
java.util.Map<java.lang.String,JSONValue> getObject()
throws JSONException
JSONException - If this value does not represent an object.
JSONBoolean asJSONBoolean()
throws JSONException
JSONException - If this value is not convertible to a boolean.
JSONNumber asJSONNumber()
throws JSONException
JSONException - If this value is not convertible to a number.
JSONString asJSONString()
throws JSONException
JSONException - If this value is not convertible to a boolean.
JSONArray asJSONArray()
throws JSONException
JSONException - If this value is not convertible to an array.
JSONObject asJSONObject()
throws JSONException
JSONException - If this value is not convertible to an object.
void write(java.io.Writer writer)
throws java.io.IOException
writer - The writer to write to.
java.io.IOException - If any IO errors occur.java.lang.String toJSONString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||