get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JsonArray
, JsonObject
, Number
, String
, or the JsonObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.{@code JSONArray} has the same type coercion behavior andoptional/mandatory accessors as {@link JSONObject}. See that class' documentation for details.
Warning: this class represents null in two incompatible ways: the standard Java {@code null} reference, and the sentinel value {@link JSONObject#NULL}. In particular, {@code get} fails if the requested indexholds the null reference, but succeeds if it holds {@code JSONObject.NULL}.
Instances of this class are not thread safe. Although this class is nonfinal, it was not designed for inheritance and should not be subclassed. In particular, self-use by overridable methods is not specified. See Effective Java Item 17, "Design and Document or inheritance or else prohibit it" for further information.
get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix. Elements can be added using one of the add(name, value)
methods. Accepted values are either instances of {@link JsonValue}, strings, primitive numbers, or boolean values. To replace an element of an array, the set(name, value)
methods can be used.
Elements can be accessed by their index using {@link #get(int)}. This class also supports iterating over the elements in document order using an {@link #iterator()} or an enhanced forloop:
for( JsonValue value : jsonArray ) { ... }
An equivalent {@link List} can be obtained from the method {@link #values()}.
Note that this class is not thread-safe. If multiple threads access a JsonArray
instance concurrently, while at least one of these threads modifies the contents of this array, access to the instance must be synchronized externally. Failure to do so may lead to an inconsistent state.
This class is not supposed to be extended by clients.
get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix. Elements can be added using the add(...)
methods which accept instances of {@link JsonValue}, strings, primitive numbers, and boolean values. To replace an element of an array, use the set(int, ...)
methods.
Elements can be accessed by their index using {@link #get(int)}. This class also supports iterating over the elements in document order using an {@link #iterator()} or an enhanced forloop:
for( JsonValue value : jsonArray ) { ... }
An equivalent {@link List} can be obtained from the method {@link #values()}.
Note that this class is not thread-safe. If multiple threads access a JsonArray
instance concurrently, while at least one of these threads modifies the contents of this array, access to the instance must be synchronized externally. Failure to do so may lead to an inconsistent state.
This class is not supposed to be extended by clients.
get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JsonArray
, JsonObject
, Number
, String
, or the JsonObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).The constructor can convert a JSON external form string into an internal form Java object. The toString() method creates an external form string.
A get() method returns a value if one can be found, and throws an exception if one cannot be found. An opt() method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get() and opt() methods return an object which you can cast or query for type. There are also typed get() and opt() methods that do typing checking and type coersion for you.
The texts produced by the toString() methods are very strict. The constructors are more forgiving in the texts they will accept.
,
(comma) may appear just before the closing bracket.,
(comma) elision.'
(single quote).{ } [ ] / \ : , ' "
Public Domain 2002 JSON.org @author JSON.org @version 0.1
get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text. A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values. The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you. The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept: ,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.A JsonArray instance can be created from a input source using {@link JsonReader#readArray()}. For example:
JsonReader jsonReader = new JsonReader(...); JsonArray array = jsonReader.readArray(); jsonReader.close();
It can also be built from scratch using a {@link JsonArrayBuilder}. For example 1: An empty JSON array can be built as follows:
JsonArray array = new JsonArrayBuilder().build();
For example 2: The following JSON [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ]
can be built using : JsonArray value = new JsonArrayBuilder() .add(new JsonObjectBuilder() .add("type", "home") .add("number", "212 555-1234")) .add(new JsonObjectBuilder() .add("type", "fax") .add("number", "646 555-4567")) .build();
{@code JsonArray} can be written to JSON as follows: JsonArray arr = ...; JsonWriter writer = new JsonWriter(...) writer.writeArray(arr); writer.close();
{@code JsonArray} values can be {@link JsonObject}, {@link JsonArray}, {@link JsonString}, {@link JsonNumber}, {@link JsonValue#TRUE}, {@link JsonValue#FALSE}, {@link JsonValue#NULL}. These values can be accessed using various accessor methods. In the above example 2, home number "212 555-1234" can be got using:
JsonObject home = array.getValue(0, JsonObject.class); String number = home.getStringValue("number");
This list object provides read-only access to the JSON array data, and attempts to modify the list, whether direct or via its collection views, result in an {@code UnsupportedOperationException}.
@author Jitendra Kotamraju
get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.The constructor can convert a JSON external form string into an internal form Java object. The toString() method creates an external form string.
A get() method returns a value if one can be found, and throws an exception if one cannot be found. An opt() method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get() and opt() methods return an object which you can cast or query for type. There are also typed get() and opt() methods that do typing checking and type coersion for you.
The texts produced by the toString() methods are very strict. The constructors are more forgiving in the texts they will accept.
,
(comma) may appear just before the closing bracket.,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
as well as by ,
0-
(octal) or 0x-
(hex) prefix.#
get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text. A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values. The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you. The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept: ,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text. A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values. The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you. The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept: ,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, {@code string}, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or {@code null}.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text. A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values. The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coersion for you. The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept: ,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma). 0-
(octal) or 0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text. A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values. The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you. The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept: ,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0x-
(hex) prefix.get
and opt
methods for accessing the values by index, and put
methods for adding or replacing values. The values can be any of these types: Boolean
, JSONArray
, JSONObject
, Number
, String
, or the JSONObject.NULL object
. The constructor can convert a JSON text into a Java object. The toString
method converts to JSON text.
A get
method returns a value if one can be found, and throws an exception if one cannot be found. An opt
method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.
The generic get()
and opt()
methods return an object which you can cast or query for type. There are also typed get
and opt
methods that do type checking and type coercion for you.
The texts produced by the toString
methods strictly conform to JSON syntax rules. The constructors are more forgiving in the texts they will accept:
,
(comma) may appear just before the closing bracket.null
value will be inserted when there is ,
(comma) elision.'
(single quote).{ } [ ] / \ : , = ; #
and if they do not look like numbers and if they are not the reserved words true
, false
, or null
.;
(semicolon) as well as by ,
(comma).0-
(octal) or 0x-
(hex) prefix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|