Uses of Class
org.kordamp.json.JSONObject
Packages that use JSONObject
Package
Description
The core of the library
Support for custom serialization
Testing utilities
Miscelaneous utilities
Utilities for trasforming JSON to XML and back.
-
Uses of JSONObject in org.kordamp.json
Methods in org.kordamp.json that return JSONObjectModifier and TypeMethodDescriptionprivate JSONObject
JSONObject._accumulate
(String key, Object value, JsonConfig jsonConfig) private JSONObject
JSONObject._setInternal
(String key, Object value, JsonConfig jsonConfig) Put a key/value pair in the JSONObject.JSONObject.accumulate
(String key, boolean value) Accumulate values under a key.JSONObject.accumulate
(String key, double value) Accumulate values under a key.JSONObject.accumulate
(String key, int value) Accumulate values under a key.JSONObject.accumulate
(String key, long value) Accumulate values under a key.JSONObject.accumulate
(String key, Object value) Accumulate values under a key.JSONObject.accumulate
(String key, Object value, JsonConfig jsonConfig) Accumulate values under a key.static JSONObject
JSONObject.Impl.defaultBeanProcessing
(Object bean, JsonConfig jsonConfig) Remove a name and its value, if present.Put a key/boolean pair in the JSONObject.Put a key/double pair in the JSONObject.Put a key/int pair in the JSONObject.Put a key/long pair in the JSONObject.Put a key/value pair in the JSONObject.JSONObject.element
(String key, Object value, JsonConfig jsonConfig) Put a key/value pair in the JSONObject.JSONObject.element
(String key, Collection value) Put a key/value pair in the JSONObject, where the value will be a JSONArray which is produced from a Collection.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.Put a key/value pair in the JSONObject, where the value will be a JSONObject which is produced from a Map.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.elementOpt
(String key, Object value) Put a key/value pair in the JSONObject, but only if the key and the value are both non-null.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 JSONObject
JSONObject.Impl.fromBean
(Object bean, JsonConfig jsonConfig) Creates a JSONObject from a POJO.
Supports nested maps, POJOs, and arrays/collections.static JSONObject
JSONObject.Impl.fromDynaBean
(org.apache.commons.beanutils.DynaBean bean, JsonConfig jsonConfig) static JSONObject
JSONObject.Impl.fromJSONObject
(JSONObject object, JsonConfig jsonConfig) static JSONObject
JSONObject.Impl.fromJSONString
(JSONString string, JsonConfig jsonConfig) static JSONObject
JSONObject.Impl.fromJSONTokener
(JSONTokener tokener, JsonConfig jsonConfig) static JSONObject
JSONObject.Impl.fromMap
(Map map, JsonConfig jsonConfig) static JSONObject
JSONObject.fromObject
(Object object) Creates a JSONObject.
Inspects the object type to call the correct JSONObject 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 JSONObject
JSONObject.Impl.fromString
(String str, JsonConfig jsonConfig) JSONArray.getJSONObject
(int index) Get the JSONObject associated with an index.JSONObject.getJSONObject
(String key) Get the JSONObject value associated with a key.JSONArray.optJSONObject
(int index) Get the optional JSONObject associated with an index.JSONObject.optJSONObject
(String key) Get an optional JSONObject associated with a key.private JSONObject
JSONObject.setInternal
(String key, Object value, JsonConfig jsonConfig) Put a key/value pair in the JSONObject.JSONArray.toJSONObject
(JSONArray names) Produce a JSONObject by combining a JSONArray of names with the values of this JSONArray.Methods in org.kordamp.json with parameters of type JSONObjectModifier and TypeMethodDescriptionJSONArray.element
(JSONObject value) Append an JSON value.static JSONObject
JSONObject.Impl.fromJSONObject
(JSONObject object, JsonConfig jsonConfig) AbstractJSON.WritingVisitor.keySet
(JSONObject o) static void
JSONObject.Impl.setValue
(JSONObject jsonObject, String key, Object value, Class type, JsonConfig jsonConfig, boolean bypass) static Object
JSONObject.toBean
(JSONObject jsonObject) static Object
JSONObject.toBean
(JSONObject jsonObject, Class beanClass) Creates a bean from a JSONObject, with a specific target class.static Object
JSONObject.toBean
(JSONObject jsonObject, Class beanClass, Map classMap) Creates a bean from a JSONObject, with a specific target class.
If beanClass is null, this method will return a graph of DynaBeans.static Object
JSONObject.toBean
(JSONObject jsonObject, Object bean, JsonConfig jsonConfig) Creates a bean from a JSONObject, with the specific configuration.static Object
JSONObject.toBean
(JSONObject jsonObject, JsonConfig jsonConfig) Creates a bean from a JSONObject, with the specific configuration. -
Uses of JSONObject in org.kordamp.json.processors
Methods in org.kordamp.json.processors that return JSONObjectModifier and TypeMethodDescriptionJsDateJsonBeanProcessor.processBean
(Object bean, JsonConfig jsonConfig) Processes the input bean into a compatible JsDate.JsonBeanProcessor.processBean
(Object bean, JsonConfig jsonConfig) Processes the bean an returns a suitable JSONObject representation. -
Uses of JSONObject in org.kordamp.json.test
Methods in org.kordamp.json.test with parameters of type JSONObjectModifier and TypeMethodDescriptionstatic void
JSONAssert.assertEquals
(String message, String expected, JSONObject actual) Asserts that two JSONObjects are equal.static void
JSONAssert.assertEquals
(String expected, JSONObject actual) Asserts that two JSONObjects are equal.static void
JSONAssert.assertEquals
(String message, JSONObject expected, String actual) Asserts that two JSONObjects are equal.static void
JSONAssert.assertEquals
(String message, JSONObject expected, JSONObject actual) Asserts that two JSONObjects are equal.static void
JSONAssert.assertEquals
(JSONObject expected, String actual) Asserts that two JSONObjects are equal.static void
JSONAssert.assertEquals
(JSONObject expected, JSONObject actual) Asserts that two JSONObjects are equal.private static String
JSONAssert.missingAndUnexpectedNames
(JSONObject expected, JSONObject actual) private static String
JSONAssert.missingExpectedNames
(JSONObject expected, JSONObject actual) private static String
JSONAssert.unexpectedNames
(JSONObject expected, JSONObject actual) -
Uses of JSONObject in org.kordamp.json.util
Fields in org.kordamp.json.util declared as JSONObjectModifier and TypeFieldDescriptionstatic final JSONObject
CycleDetectionStrategy.IGNORE_PROPERTY_OBJ
Methods in org.kordamp.json.util that return JSONObjectModifier and TypeMethodDescriptionabstract JSONObject
CycleDetectionStrategy.handleRepeatedReferenceAsObject
(Object reference) Handle a repeated reference
Must return a valid JSONObject or null.CycleDetectionStrategy.LenientCycleDetectionStrategy.handleRepeatedReferenceAsObject
(Object reference) CycleDetectionStrategy.LenientNoRefCycleDetectionStrategy.handleRepeatedReferenceAsObject
(Object reference) CycleDetectionStrategy.StrictCycleDetectionStrategy.handleRepeatedReferenceAsObject
(Object reference) Methods in org.kordamp.json.util with parameters of type JSONObjectModifier and TypeMethodDescriptionstatic Map
JSONUtils.getProperties
(JSONObject jsonObject) Creates a Map with all the properties of the JSONObject.static org.apache.commons.beanutils.DynaBean
JSONUtils.newDynaBean
(JSONObject jsonObject) Creates a new MorphDynaBean from a JSONObject.static org.apache.commons.beanutils.DynaBean
JSONUtils.newDynaBean
(JSONObject jsonObject, JsonConfig jsonConfig) Creates a new MorphDynaBean from a JSONObject.NewBeanInstanceStrategy.DefaultNewBeanInstanceStrategy.newInstance
(Class target, JSONObject source) abstract Object
NewBeanInstanceStrategy.newInstance
(Class target, JSONObject source) Creates a new instance.private static String
WebUtils.toString
(JSONObject jsonObject) -
Uses of JSONObject in org.kordamp.json.xml
Methods in org.kordamp.json.xml with parameters of type JSONObjectModifier and TypeMethodDescriptionprivate nu.xom.Element
XMLSerializer.processJSONObject
(JSONObject jsonObject, nu.xom.Element root, String[] expandableProperties, boolean isRoot) private void
XMLSerializer.setOrAccumulate
(JSONObject jsonObject, String key, Object value) private void
XMLSerializer.setValue
(JSONObject jsonObject, nu.xom.Element element, String defaultType) private Object
XMLSerializer.simplifyValue
(JSONObject parent, Object json)