Class PojoUtility
java.lang.Object
org.alfresco.rest.rm.community.util.PojoUtility
Utility class for creating the json object
- Since:
- 2.6
- Author:
- Rodica Sutu
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>jsonToObject(org.json.JSONArray json, Class<T> classz) Converting json array into a list of java objectsstatic <T> TjsonToObject(org.json.JSONObject json, Class<T> classz) Converting json to java objectstatic Stringstatic StringConverting object to JSON string
-
Method Details
-
toJson
-
toJson
Converting object to JSON string- Parameters:
model- The java object model to converttarget- Class (or interface) whose annotations to effectively overridemixinSource- Class (or interface) whose annotations are to be "added" to target's annotations, overriding as necessary- Returns:
- The converted java object as JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- Throws exceptions if the given object doesn't match to the POJO class model
-
jsonToObject
Converting json to java object- Parameters:
json- The json object to convertclassz- Class for the java object- Returns:
- The converted java object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- Throws exceptions if the given object doesn't match to the POJO class model
-
jsonToObject
Converting json array into a list of java objects- Parameters:
json- The json array to convertclassz- Class for the java object- Returns:
- The list of converted java objects
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- Throws exceptions if the given object doesn't match to the POJO class model
-