|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile 11g Release 2 (11.1.2.3.0) E27204-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.adfmf.framework.api.JSONBeanSerializationHelper
public class JSONBeanSerializationHelper
JSONBeanSerializationHelper will (de)serialize objects in and out of a JSON object.
The following classes are used to support this functionality:
Supported types:
JSONSerializable, PostJSONSerializable, JSONDeserializable, PostJSONDeserializable, ISO8601DateTimeUtil| Constructor Summary | |
|---|---|
JSONBeanSerializationHelper() |
|
| Method Summary | |
|---|---|
static java.lang.Object |
fromJSON(java.lang.Class type, java.lang.Object json)Method used to deserialize the passed-in Object to Java object. |
static java.lang.Object |
fromJSON(java.lang.Class type, java.lang.String jsonString)Method used to deserialize the passed-in Object to Java object. |
static boolean |
getBoolean(java.lang.Object object)Used to coerce an object into a boolean if possible. |
static byte |
getByte(java.lang.Object object)Used to coerce an object into a byte if possible. |
static char |
getCharacter(java.lang.Object object)Used to coerce an object into a char if possible. |
static double |
getDouble(java.lang.Object object)Used to coerce an object into a double if possible. |
static float |
getFloat(java.lang.Object object)Used to coerce an object into a float if possible. |
static int |
getIdFromJSONObject(oracle.adfmf.json.JSONObject jsonObj)Gets id from the json object and returns the corresponding int value Internal Utility Function |
static int |
getInteger(java.lang.Object object)Used to coerce an object into a int if possible. |
static long |
getLong(java.lang.Object object)Used to coerce an object into a long if possible. |
static short |
getShort(java.lang.Object object)Used to coerce an object into a short if possible. |
static java.lang.String |
getString(java.lang.Object object)Used to coerce an object into a String if possible. |
static boolean |
isObjectNull(java.lang.Object json)Utility method to determine if the JSON object is null. |
static void |
removeBooleanFromJSON(oracle.adfmf.json.JSONObject jsonObj, boolean bValue, java.lang.String[] keys)Normalizes the JSON object by removing the objects which contain specified boolean value. |
static void |
removeNegativesFromJSON(oracle.adfmf.json.JSONObject jsonObj, java.lang.String[] keys)Normalizes the JSON object by removing the objects which contain value: -1. |
static void |
removeNullsFromJSON(oracle.adfmf.json.JSONObject jsonObj, java.lang.String[] keys)Normalizes the JSON object by removing the objects which contain null's. |
static java.lang.Object |
toJSON(java.lang.Object obj)Method used to serialize the passed in Java object to JSON. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSONBeanSerializationHelper()
| Method Detail |
|---|
public static java.lang.Object fromJSON(java.lang.Class type,
java.lang.String jsonString)
throws java.lang.Exception
JSONBeanSerializationHelper.fromJSON(type, new JSONObject(jsonString));type - Class to which JSON Object should be deserialized tojsonString - String representing a JSON object.java.lang.Exception
public static java.lang.Object fromJSON(java.lang.Class type,
java.lang.Object json)
throws java.lang.Exception
Please refer to the following for more advanced ideas:
type - Class to which JSON Object should be deserialized tojson - Object to be deserializedjava.lang.ExceptionJSONDeserializable, PostJSONDeseralizable, JSONBeanSerializationHelper, ISO8601DateTimeUtil
public static java.lang.Object toJSON(java.lang.Object obj)
throws java.lang.Exception
Please refer to the following for more advanced ideas:
obj - Object to be serializedjava.lang.ExceptionJSONSerializable, PostJSONSerializablepublic static boolean isObjectNull(java.lang.Object json)
public static void removeNullsFromJSON(oracle.adfmf.json.JSONObject jsonObj,
java.lang.String[] keys)
public static void removeNegativesFromJSON(oracle.adfmf.json.JSONObject jsonObj,
java.lang.String[] keys)
public static void removeBooleanFromJSON(oracle.adfmf.json.JSONObject jsonObj,
boolean bValue,
java.lang.String[] keys)
public static int getIdFromJSONObject(oracle.adfmf.json.JSONObject jsonObj)
throws oracle.adfmf.json.JSONException
oracle.adfmf.json.JSONException
public static boolean getBoolean(java.lang.Object object)
throws java.lang.Exception
object - to coercejava.lang.Exceptionpublic static byte getByte(java.lang.Object object)
object - to coercejava.lang.Exceptionpublic static char getCharacter(java.lang.Object object)
object - to coercejava.lang.Exceptionpublic static double getDouble(java.lang.Object object)
object - to coercejava.lang.Exceptionpublic static float getFloat(java.lang.Object object)
object - to coercejava.lang.Exceptionpublic static int getInteger(java.lang.Object object)
object - to coercejava.lang.Exceptionpublic static long getLong(java.lang.Object object)
object - to coercejava.lang.Exceptionpublic static short getShort(java.lang.Object object)
object - to coercejava.lang.Exceptionpublic static java.lang.String getString(java.lang.Object object)
object - to coercejava.lang.Exception
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile 11g Release 2 (11.1.2.3.0) E27204-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||