Class JsonValue

java.lang.Object
com.eclipsesource.json.JsonValue
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JsonArray, JsonObject

public abstract class JsonValue extends Object implements Serializable
Represents a JSON value. This can be a JSON object, an array, a number, a string, or one of the literals true, false, and null.

The literals true, false, and null are represented by the constants Json.TRUE, Json.FALSE, and Json.NULL.

JSON objects and arrays are represented by the subtypes JsonObject and JsonArray. Instances of these types can be created using the public constructors of these classes.

Instances that represent JSON numbers, strings and boolean values can be created using the static factory methods Json.value(String), Json.value(long), Json.value(double), etc.

In order to find out whether an instance of this class is of a certain type, the methods isObject(), isArray(), isString(), isNumber() etc. can be used.

If the type of a JSON value is known, the methods asObject(), asArray(), asString(), asInt(), etc. can be used to get this value directly in the appropriate target type.

This class is not supposed to be extended by clients.

See Also: