public class RESTUtils extends Object
Constructor and Description |
---|
RESTUtils() |
Modifier and Type | Method and Description |
---|---|
static Object |
getIdentityForURLToken(org.datanucleus.metadata.AbstractClassMetaData cmd,
String token,
org.datanucleus.PersistenceNucleusContext nucCtx) |
static JSONArray |
getJSONArrayFromCollection(Collection coll,
org.datanucleus.ExecutionContext ec)
Method to convert the provided POJO into its equivalent JSONObject.
|
static JSONObject |
getJSONObjectFromPOJO(Object obj,
org.datanucleus.ExecutionContext ec)
Method to convert the provided POJO into its equivalent JSONObject.
|
static Object |
getNonPersistableObjectFromJSONObject(JSONObject jsonobj,
Class cls,
org.datanucleus.NucleusContext nucCtx)
Deserialise from JSON to an object.
|
static Object |
getObjectFromJSONObject(JSONObject jsonobj,
String className,
org.datanucleus.ExecutionContext ec)
Method to convert the provided JSONObject into its equivalent object.
|
public static JSONArray getJSONArrayFromCollection(Collection coll, org.datanucleus.ExecutionContext ec)
coll
- Collection of POJOsec
- ExecutionContextpublic static JSONObject getJSONObjectFromPOJO(Object obj, org.datanucleus.ExecutionContext ec)
obj
- The objectec
- ExecutionContextpublic static Object getObjectFromJSONObject(JSONObject jsonobj, String className, org.datanucleus.ExecutionContext ec)
ClassNotResolvedException
when the class is not found.
Throws JDOFatalUserException
if other error occurred.jsonobj
- JSONObjectclassName
- Name of the classec
- ExecutionContextpublic static Object getIdentityForURLToken(org.datanucleus.metadata.AbstractClassMetaData cmd, String token, org.datanucleus.PersistenceNucleusContext nucCtx)
public static Object getNonPersistableObjectFromJSONObject(JSONObject jsonobj, Class cls, org.datanucleus.NucleusContext nucCtx)
jsonobj
- JSONObjectcls
- The classnucCtx
- NucleusContextCopyright © 2016. All rights reserved.