Class JSONObject.Impl
java.lang.Object
org.kordamp.json.JSONObject.Impl
- Enclosing class:
JSONObject
This class is considered private API.
It should only be used for developers extending the capabilities of the library and/or those writing custom JSON Bean/Value processors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectconvertPropertyValueToArray(String key, Object value, Class targetType, JsonConfig jsonConfig, Map classMap) static CollectionconvertPropertyValueToCollection(String key, Object value, JsonConfig jsonConfig, String name, Map classMap, Class collectionType) static ListconvertPropertyValueToList(String key, Object value, JsonConfig jsonConfig, String name, Map classMap) static JSONObjectdefaultBeanProcessing(Object bean, JsonConfig jsonConfig) static ClassfindTargetClass(String key, Map classMap) Locates a Class associated to a specifi key.
The key may be a regexp.static JSONObjectfromBean(Object bean, JsonConfig jsonConfig) Creates a JSONObject from a POJO.
Supports nested maps, POJOs, and arrays/collections.static JSONObjectfromDynaBean(org.apache.commons.beanutils.DynaBean bean, JsonConfig jsonConfig) static JSONObjectfromJSONObject(JSONObject object, JsonConfig jsonConfig) static JSONObjectfromJSONString(JSONString string, JsonConfig jsonConfig) static JSONObjectfromJSONTokener(JSONTokener tokener, JsonConfig jsonConfig) static JSONObjectfromMap(Map map, JsonConfig jsonConfig) static JSONObjectfromString(String str, JsonConfig jsonConfig) static JSONObject.PropertygetProperty(Class beanClass, Object bean, String key, JsonConfig jsonConfig) static booleanisTransient(AnnotatedElement element, JsonConfig jsonConfig) static booleanisTransientField(Field field, JsonConfig jsonConfig) static booleanisTransientField(String name, Class beanClass, JsonConfig jsonConfig) static ObjectmorphPropertyValue(String key, Object value, Class type, Class targetType) static ClassresolveClass(Map classMap, String key, String name, Class type) static voidsetProperty(Object bean, String key, Object value, JsonConfig jsonConfig) Sets a property on the target bean.
Bean may be a Map or a POJO.static voidsetValue(JSONObject jsonObject, String key, Object value, Class type, JsonConfig jsonConfig, boolean bypass)
-
Constructor Details
-
Impl
public Impl()
-
-
Method Details
-
getProperty
public static JSONObject.Property getProperty(Class beanClass, Object bean, String key, JsonConfig jsonConfig) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException -
defaultBeanProcessing
-
fromBean
Creates a JSONObject from a POJO.
Supports nested maps, POJOs, and arrays/collections.- Parameters:
bean- An object with POJO conventions- Throws:
JSONException- if the bean can not be converted to a proper JSONObject.
-
fromDynaBean
public static JSONObject fromDynaBean(org.apache.commons.beanutils.DynaBean bean, JsonConfig jsonConfig) -
fromJSONObject
-
fromJSONString
-
fromJSONTokener
-
fromMap
-
fromString
-
convertPropertyValueToArray
-
convertPropertyValueToList
-
convertPropertyValueToCollection
public static Collection convertPropertyValueToCollection(String key, Object value, JsonConfig jsonConfig, String name, Map classMap, Class collectionType) -
resolveClass
-
findTargetClass
-
isTransientField
-
isTransientField
-
isTransient
-
morphPropertyValue
-
setProperty
-
setValue
public static void setValue(JSONObject jsonObject, String key, Object value, Class type, JsonConfig jsonConfig, boolean bypass)
-