JsonValue children are a linked list. Iteration of arrays or objects is easily done using a for loop, either with the enhanced for loop syntactic sugar or like the example below. This is much more efficient than accessing children by index when there are many children.
JsonValue map = ...; for (JsonValue entry = map.child(); entry != null; entry = entry.next()) System.out.println(entry.name() + " = " + entry.asString());@author Nathan Sweet
The literal names true, false, and null are represented by the constants {@link #TRUE}, {@link #FALSE}, and {@link #NULL}.
JSON objects and arrays are represented by the subtypes {@link JsonObject} and {@link JsonArray}. Instances of these types can be created using the public constructors.
Instances for JSON numbers and strings can be created using the static factory methods {@link #valueOf(String)}, {@link #valueOf(long)}, {@link #valueOf(double)}, etc.
In order to find out whether an instance of this class is of a certain type, the methods {@link #isObject()}, {@link #isArray()}, {@link #isString()}, {@link #isNumber()} etc. can beused.
If there is no doubt about the type of a JSON value, one of the methods {@link #asObject()}, {@link #asArray()}, {@link #asString()}, {@link #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.
The literals true, false, and null are represented by the constants {@link #TRUE}, {@link #FALSE}, and {@link #NULL}.
JSON objects and arrays are represented by the subtypes {@link JsonObject} and {@link 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 {@link #valueOf(String)}, {@link #valueOf(long)}, {@link #valueOf(double)}, etc.
In order to find out whether an instance of this class is of a certain type, the methods {@link #isObject()}, {@link #isArray()}, {@link #isString()}, {@link #isNumber()} etc. can beused.
If the type of a JSON value is known, the methods {@link #asObject()}, {@link #asArray()}, {@link #asString()}, {@link #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.
JsonValue
represents a JSON value. A JSON value is an {@link JsonObject object}, {@link JsonArray array}, {@link JsonNumber number}, {@link JsonString string}, {@link JsonValue#TRUE true}, {@link JsonValue#FALSE false}, {@link JsonValue#NULL null}
@author Jitendra Kotamraju
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|