Google Web Toolkit (Beta)
Search this site:

# Class JSONValue

public class JSONValue
extends Object
// Superclass of `JSONString`, `JSONObject`, `JSONNumber`, `JSONNull`, `JSONBoolean`, `JSONArray`
The superclass of all JSON value types.

## Methods

isArray() | Returns a non-null reference if this JSONValue is really a JSONArray.
isBoolean() | Returns a non-null reference if this JSONValue is really a JSONBoolean.
isNull() | Returns a non-null reference if this JSONValue is really a JSONNull.
isNumber() | Returns a non-null reference if this JSONValue is really a JSONNumber.
isObject() | Returns non-null if this JSONValue is really a JSONObject.
isString() | Returns a non-null reference if this JSONValue is really a JSONString.
toString() | Returns a JSON-encoded string for this entity.

## See Also

JSONArray, JSONBoolean, JSONNumber, JSONObject, JSONString

## Method Detail

### isArray

public JSONArray isArray()
Returns a non-null reference if this JSONValue is really a JSONArray.

#### Return Value

a reference to a JSONArray if this JSONValue is a JSONArray or `null` otherwise.

### isBoolean

public JSONBoolean isBoolean()
Returns a non-null reference if this JSONValue is really a JSONBoolean.

#### Return Value

a reference to a JSONBoolean if this JSONValue is a JSONBoolean or `null` otherwise.

### isNull

public JSONNull isNull()
Returns a non-null reference if this JSONValue is really a JSONNull.

#### Return Value

a reference to a JSONNull if this JSONValue is a JSONNull or `null` otherwise.

### isNumber

public JSONNumber isNumber()
Returns a non-null reference if this JSONValue is really a JSONNumber.

#### Return Value

a reference to a JSONNumber if this JSONValue is a JSONNumber or `null` otherwise.

### isObject

public JSONObject isObject()
Returns non-null if this JSONValue is really a JSONObject.

#### Return Value

a reference to a JSONObject if this JSONValue is a JSONObject or `null` otherwise.

### isString

public JSONString isString()
Returns a non-null reference if this JSONValue is really a JSONString.

#### Return Value

a reference to a JSONString if this JSONValue is a JSONString or `null` otherwise.

### toString

public abstract String toString()
throws JSONException
Returns a JSON-encoded string for this entity. Use this method to create JSON strings that can be sent from the client to a server.