Package | Description |
---|---|
org.kordamp.json |
The core of the library
|
org.kordamp.json.test |
Testing utilities
|
org.kordamp.json.util |
Miscelaneous utilities
|
Modifier and Type | Method and Description |
---|---|
protected JSONArray |
JSONArray.addString(String str)
Adds a String without performing any conversion on it.
|
JSONArray |
JSONArray.discard(int index)
Remove an element, if present.
|
JSONArray |
JSONArray.discard(Object o)
Remove an element, if present.
|
JSONArray |
JSONArray.element(boolean value)
Append a boolean value.
|
JSONArray |
JSONArray.element(Collection value)
Append a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.
|
JSONArray |
JSONArray.element(Collection value,
JsonConfig jsonConfig)
Append a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.
|
JSONArray |
JSONArray.element(double value)
Append a double value.
|
JSONArray |
JSONArray.element(int value)
Append an int value.
|
JSONArray |
JSONArray.element(int index,
boolean value)
Put or replace a boolean value in the JSONArray.
|
JSONArray |
JSONArray.element(int index,
Collection value)
Put a value in the JSONArray, where the value will be a JSONArray which is
produced from a Collection.
|
JSONArray |
JSONArray.element(int index,
Collection value,
JsonConfig jsonConfig)
Put a value in the JSONArray, where the value will be a JSONArray which is
produced from a Collection.
|
JSONArray |
JSONArray.element(int index,
double value)
Put or replace a double value.
|
JSONArray |
JSONArray.element(int index,
int value)
Put or replace an int value.
|
JSONArray |
JSONArray.element(int index,
long value)
Put or replace a long value.
|
JSONArray |
JSONArray.element(int index,
Map value)
Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.
|
JSONArray |
JSONArray.element(int index,
Map value,
JsonConfig jsonConfig)
Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.
|
JSONArray |
JSONArray.element(int index,
Object value)
Put or replace an object value in the JSONArray.
|
JSONArray |
JSONArray.element(int index,
Object value,
JsonConfig jsonConfig)
Put or replace an object value in the JSONArray.
|
JSONArray |
JSONArray.element(int index,
String value)
Put or replace a String value in the JSONArray.
|
JSONArray |
JSONArray.element(int index,
String value,
JsonConfig jsonConfig)
Put or replace a String value in the JSONArray.
|
JSONArray |
JSONArray.element(JSONNull value)
Append an JSON value.
|
JSONArray |
JSONArray.element(JSONObject value)
Append an JSON value.
|
JSONArray |
JSONArray.element(long value)
Append an long value.
|
JSONArray |
JSONArray.element(Map value)
Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.
|
JSONArray |
JSONArray.element(Map value,
JsonConfig jsonConfig)
Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.
|
JSONArray |
JSONArray.element(Object value)
Append an object value.
|
JSONArray |
JSONArray.element(Object value,
JsonConfig jsonConfig)
Append an object value.
|
JSONArray |
JSONArray.element(String value)
Append a String value.
|
JSONArray |
JSONArray.element(String value,
JsonConfig jsonConfig)
Append a String value.
|
static JSONArray |
JSONArray.Impl.fromArray(boolean[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an boolean[].
|
static JSONArray |
JSONArray.Impl.fromArray(byte[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an byte[].
|
static JSONArray |
JSONArray.Impl.fromArray(char[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an char[].
|
static JSONArray |
JSONArray.Impl.fromArray(double[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an double[].
|
static JSONArray |
JSONArray.Impl.fromArray(Enum e,
JsonConfig jsonConfig)
Construct a JSONArray from an Enum value.
|
static JSONArray |
JSONArray.Impl.fromArray(float[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an float[].
|
static JSONArray |
JSONArray.Impl.fromArray(int[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an int[].
|
static JSONArray |
JSONArray.Impl.fromArray(long[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an long[].
|
static JSONArray |
JSONArray.Impl.fromArray(Object[] array,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.Impl.fromArray(short[] array,
JsonConfig jsonConfig)
Construct a JSONArray from an short[].
|
static JSONArray |
JSONArray.Impl.fromCollection(Collection collection,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.Impl.fromJSONArray(JSONArray array,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.Impl.fromJSONString(JSONString string,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.Impl.fromJSONTokener(JSONTokener tokener,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.fromObject(Object object)
Creates a JSONArray.
Inspects the object type to call the correct JSONArray factory method. |
static JSONArray |
JSONArray.fromObject(Object object,
JsonConfig jsonConfig)
Creates a JSONArray.
Inspects the object type to call the correct JSONArray factory method. |
static JSONArray |
JSONArray.Impl.fromString(String string,
JsonConfig jsonConfig) |
JSONArray |
JSONArray.getJSONArray(int index)
Get the JSONArray associated with an index.
|
JSONArray |
JSONObject.getJSONArray(String key)
Get the JSONArray value associated with a key.
|
JSONArray |
JSONObject.names()
Produce a JSONArray containing the names of the elements of this
JSONObject.
|
JSONArray |
JSONObject.names(JsonConfig jsonConfig)
Produce a JSONArray containing the names of the elements of this
JSONObject.
|
JSONArray |
JSONArray.optJSONArray(int index)
Get the optional JSONArray associated with an index.
|
JSONArray |
JSONObject.optJSONArray(String key)
Get an optional JSONArray associated with a key.
|
JSONArray |
JSONObject.toJSONArray(JSONArray names)
Produce a JSONArray containing the values of the members of this
JSONObject.
|
Modifier and Type | Method and Description |
---|---|
static JSONArray |
JSONArray.Impl.fromJSONArray(JSONArray array,
JsonConfig jsonConfig) |
static int[] |
JSONArray.getDimensions(JSONArray jsonArray)
Returns the number of dimensions suited for a java array.
|
static void |
JSONArray.Impl.processArrayDimensions(JSONArray jsonArray,
List dims,
int index) |
static Object |
JSONArray.toArray(JSONArray jsonArray)
Creates a java array from a JSONArray.
|
static Object |
JSONArray.toArray(JSONArray jsonArray,
Class objectClass)
Creates a java array from a JSONArray.
|
static Object |
JSONArray.toArray(JSONArray jsonArray,
Class objectClass,
Map classMap)
Creates a java array from a JSONArray.
Any attribute is a JSONObject and matches a key in the classMap, it will be converted to that target class. The classMap has the following conventions: Every key must be an String. Every value must be a Class. A key may be a regular expression. |
static Object |
JSONArray.toArray(JSONArray jsonArray,
JsonConfig jsonConfig)
Creates a java array from a JSONArray.
|
static Object |
JSONArray.toArray(JSONArray jsonArray,
Object root,
JsonConfig jsonConfig)
Creates a java array from a JSONArray.
|
static Collection |
JSONArray.toCollection(JSONArray jsonArray)
Returns a List or a Set taking generics into account.
|
static Collection |
JSONArray.toCollection(JSONArray jsonArray,
Class objectClass)
Returns a List or a Set taking generics into account.
|
static Collection |
JSONArray.toCollection(JSONArray jsonArray,
JsonConfig jsonConfig)
Returns a List or a Set taking generics into account.
Contributed by [Matt Small @ WaveMaker]. |
JSONArray |
JSONObject.toJSONArray(JSONArray names)
Produce a JSONArray containing the values of the members of this
JSONObject.
|
JSONObject |
JSONArray.toJSONObject(JSONArray names)
Produce a JSONObject by combining a JSONArray of names with the values of
this JSONArray.
|
static List |
JSONArray.toList(JSONArray jsonArray)
Deprecated.
replaced by toCollection
|
static List |
JSONArray.toList(JSONArray jsonArray,
Class objectClass)
Deprecated.
replaced by toCollection
|
static List |
JSONArray.toList(JSONArray jsonArray,
Class objectClass,
Map classMap)
Deprecated.
replaced by toCollection
|
static List |
JSONArray.toList(JSONArray jsonArray,
JsonConfig jsonConfig)
Deprecated.
replaced by toCollection
|
static List |
JSONArray.toList(JSONArray jsonArray,
Object root,
JsonConfig jsonConfig)
Creates a List from a JSONArray.
|
Modifier and Type | Method and Description |
---|---|
static void |
JSONAssert.assertEquals(JSONArray expected,
JSONArray actual)
Asserts that two JSONArrays are equal.
|
static void |
JSONAssert.assertEquals(JSONArray expected,
String actual)
Asserts that two JSONArrays are equal.
|
static void |
JSONAssert.assertEquals(String expected,
JSONArray actual)
Asserts that two JSONArrays are equal.
|
static void |
JSONAssert.assertEquals(String message,
JSONArray expected,
JSONArray actual)
Asserts that two JSONArrays are equal.
|
static void |
JSONAssert.assertEquals(String message,
JSONArray expected,
String actual)
Asserts that two JSONArrays are equal.
|
static void |
JSONAssert.assertEquals(String message,
String expected,
JSONArray actual)
Asserts that two JSONArrays are equal.
|
Modifier and Type | Field and Description |
---|---|
static JSONArray |
CycleDetectionStrategy.IGNORE_PROPERTY_ARR |
Modifier and Type | Method and Description |
---|---|
abstract JSONArray |
CycleDetectionStrategy.handleRepeatedReferenceAsArray(Object reference)
Handle a repeated reference
Must return a valid JSONArray or null. |