Package | Description |
---|---|
org.kordamp.json |
The core of the library
|
org.kordamp.json.processors |
Support for custom serialization
|
org.kordamp.json.util |
Miscelaneous utilities
|
Modifier and Type | Method and Description |
---|---|
JsonConfig |
JsonConfig.copy() |
Modifier and Type | Method and Description |
---|---|
protected Object |
JSONArray._processValue(Object value,
JsonConfig jsonConfig) |
protected Object |
JSONObject._processValue(Object value,
JsonConfig jsonConfig) |
JSONObject |
JSONObject.accumulate(String key,
Object value,
JsonConfig jsonConfig)
Accumulate values under a key.
|
void |
JSONObject.accumulateAll(Map map,
JsonConfig jsonConfig) |
void |
JSONArray.add(int index,
Object value,
JsonConfig jsonConfig) |
boolean |
JSONArray.add(Object value,
JsonConfig jsonConfig) |
boolean |
JSONArray.addAll(Collection collection,
JsonConfig jsonConfig) |
boolean |
JSONArray.addAll(int index,
Collection collection,
JsonConfig jsonConfig) |
boolean |
JSONArray.contains(Object o,
JsonConfig jsonConfig) |
boolean |
JSONArray.containsAll(Collection collection,
JsonConfig jsonConfig) |
boolean |
JSONObject.containsValue(Object value,
JsonConfig jsonConfig) |
static Object |
JSONObject.Impl.convertPropertyValueToArray(String key,
Object value,
Class targetType,
JsonConfig jsonConfig,
Map classMap) |
static Collection |
JSONObject.Impl.convertPropertyValueToCollection(String key,
Object value,
JsonConfig jsonConfig,
String name,
Map classMap,
Class collectionType) |
static List |
JSONObject.Impl.convertPropertyValueToList(String key,
Object value,
JsonConfig jsonConfig,
String name,
Map classMap) |
static JSONObject |
JSONObject.Impl.defaultBeanProcessing(Object bean,
JsonConfig jsonConfig) |
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(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,
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,
JsonConfig jsonConfig)
Put or replace an object 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(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,
JsonConfig jsonConfig)
Append an object value.
|
JSONObject |
JSONObject.element(String key,
Collection value,
JsonConfig jsonConfig)
Put a key/value pair in the JSONObject, where the value will be a
JSONArray which is produced from a Collection.
|
JSONArray |
JSONArray.element(String value,
JsonConfig jsonConfig)
Append a String value.
|
JSONObject |
JSONObject.element(String key,
Map value,
JsonConfig jsonConfig)
Put a key/value pair in the JSONObject, where the value will be a
JSONObject which is produced from a Map.
|
JSONObject |
JSONObject.element(String key,
Object value,
JsonConfig jsonConfig)
Put a key/value pair in the JSONObject.
|
JSONObject |
JSONObject.elementOpt(String key,
Object value,
JsonConfig jsonConfig)
Put a key/value pair in the JSONObject, but only if the key and the value
are both non-null.
|
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 JSONObject |
JSONObject.Impl.fromBean(Object bean,
JsonConfig jsonConfig)
Creates a JSONObject from a POJO.
Supports nested maps, POJOs, and arrays/collections. |
static JSONArray |
JSONArray.Impl.fromCollection(Collection collection,
JsonConfig jsonConfig) |
static JSONObject |
JSONObject.Impl.fromDynaBean(org.apache.commons.beanutils.DynaBean bean,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.Impl.fromJSONArray(JSONArray array,
JsonConfig jsonConfig) |
static JSONObject |
JSONObject.Impl.fromJSONObject(JSONObject object,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.Impl.fromJSONString(JSONString string,
JsonConfig jsonConfig) |
static JSONObject |
JSONObject.Impl.fromJSONString(JSONString string,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.Impl.fromJSONTokener(JSONTokener tokener,
JsonConfig jsonConfig) |
static JSONObject |
JSONObject.Impl.fromJSONTokener(JSONTokener tokener,
JsonConfig jsonConfig) |
static JSONObject |
JSONObject.Impl.fromMap(Map map,
JsonConfig jsonConfig) |
static JSONArray |
JSONArray.fromObject(Object object,
JsonConfig jsonConfig)
Creates a JSONArray.
Inspects the object type to call the correct JSONArray factory method. |
static JSONObject |
JSONObject.fromObject(Object object,
JsonConfig jsonConfig)
Creates a JSONObject.
Inspects the object type to call the correct JSONObject factory method. |
static JSONArray |
JSONArray.Impl.fromString(String string,
JsonConfig jsonConfig) |
static JSONObject |
JSONObject.Impl.fromString(String str,
JsonConfig jsonConfig) |
static org.kordamp.json.JSONObject.Property |
JSONObject.Impl.getProperty(Class beanClass,
Object bean,
String key,
JsonConfig jsonConfig) |
static boolean |
JSONObject.Impl.isTransient(AnnotatedElement element,
JsonConfig jsonConfig) |
static boolean |
JSONObject.Impl.isTransientField(Field field,
JsonConfig jsonConfig) |
static boolean |
JSONObject.Impl.isTransientField(String name,
Class beanClass,
JsonConfig jsonConfig) |
JSONArray |
JSONObject.names(JsonConfig jsonConfig)
Produce a JSONArray containing the names of the elements of this
JSONObject.
|
void |
JSONObject.putAll(Map map,
JsonConfig jsonConfig) |
boolean |
JSONArray.removeAll(Collection collection,
JsonConfig jsonConfig) |
boolean |
JSONArray.retainAll(Collection collection,
JsonConfig jsonConfig) |
Object |
JSONArray.set(int index,
Object value,
JsonConfig jsonConfig) |
static void |
JSONObject.Impl.setProperty(Object bean,
String key,
Object value,
JsonConfig jsonConfig)
Sets a property on the target bean.
Bean may be a Map or a POJO. |
static void |
JSONObject.Impl.setValue(JSONObject jsonObject,
String key,
Object value,
Class type,
JsonConfig jsonConfig,
boolean bypass) |
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 Object |
JSONObject.toBean(JSONObject jsonObject,
JsonConfig jsonConfig)
Creates a bean from a JSONObject, with the specific configuration.
|
static Object |
JSONObject.toBean(JSONObject jsonObject,
Object bean,
JsonConfig jsonConfig)
Creates a bean from a JSONObject, with the specific configuration.
|
static Collection |
JSONArray.toCollection(JSONArray jsonArray,
JsonConfig jsonConfig)
Returns a List or a Set taking generics into account.
Contributed by [Matt Small @ WaveMaker]. |
static Object |
JSONSerializer.toJava(JSON json,
JsonConfig jsonConfig)
Transform a JSON value to a java object.
Depending on the configured values for conversion this will return a DynaBean, a bean, a List, or and array. |
static JSON |
JSONSerializer.toJSON(Object object,
JsonConfig jsonConfig)
Creates a JSONObject, JSONArray or a JSONNull from object.
Accepts JSON formatted strings, Maps, arrays, Collections, DynaBeans and JavaBeans. |
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 |
---|---|
Object |
JsDateJsonValueProcessor.processArrayValue(Object value,
JsonConfig jsonConfig) |
Object |
JsonValueProcessor.processArrayValue(Object value,
JsonConfig jsonConfig)
Processes the value an returns a suitable JSON value.
|
JSONObject |
JsDateJsonBeanProcessor.processBean(Object bean,
JsonConfig jsonConfig)
Processes the input bean into a compatible JsDate.
|
JSONObject |
JsonBeanProcessor.processBean(Object bean,
JsonConfig jsonConfig)
Processes the bean an returns a suitable JSONObject representation.
|
Object |
JsDateJsonValueProcessor.processObjectValue(String key,
Object value,
JsonConfig jsonConfig) |
Object |
JsonValueProcessor.processObjectValue(String key,
Object value,
JsonConfig jsonConfig)
Processes the value an returns a suitable JSON value.
|
Modifier and Type | Method and Description |
---|---|
static String |
JSONUtils.convertToJavaIdentifier(String key,
JsonConfig jsonConfig)
Transforms the string into a valid Java Identifier.
The default strategy is JavaIdentifierTransformer.NOOP |
static boolean |
JSONUtils.isJsonKeyword(String input,
JsonConfig jsonConfig) |
static org.apache.commons.beanutils.DynaBean |
JSONUtils.newDynaBean(JSONObject jsonObject,
JsonConfig jsonConfig)
Creates a new MorphDynaBean from a JSONObject.
|
Object |
JSONTokener.nextValue(JsonConfig jsonConfig)
Get the next value.
|
void |
PropertySetStrategy.setProperty(Object bean,
String key,
Object value,
JsonConfig jsonConfig) |