Search in sources :

Example 11 with JSONObject

use of org.activiti.engine.impl.util.json.JSONObject in project CzechIdMng by bcvsolutions.

the class AbstractRestTest method getEmbeddedList.

public List<LinkedHashMap<String, Object>> getEmbeddedList(String nameEmbeddedList, String json) throws IOException {
    JSONObject tObject = new JSONObject(json);
    String embeddedString = tObject.get("_embedded").toString();
    tObject = new JSONObject(embeddedString);
    // get embedded list
    String listString = tObject.get(nameEmbeddedList).toString();
    ObjectMapper mapper = new ObjectMapper();
    return mapper.readValue(listString, new TypeReference<List<LinkedHashMap<String, Object>>>() {
    });
}
Also used : JSONObject(org.activiti.engine.impl.util.json.JSONObject) List(java.util.List) JSONObject(org.activiti.engine.impl.util.json.JSONObject) ObjectMapper(org.codehaus.jackson.map.ObjectMapper)

Aggregations

JSONObject (org.activiti.engine.impl.util.json.JSONObject)11 JSONException (org.activiti.engine.impl.util.json.JSONException)3 List (java.util.List)1 ProcessEngineInfoImpl (org.activiti.engine.impl.ProcessEngineInfoImpl)1 ActivateProcessDefinitionCmd (org.activiti.engine.impl.cmd.ActivateProcessDefinitionCmd)1 SuspendProcessDefinitionCmd (org.activiti.engine.impl.cmd.SuspendProcessDefinitionCmd)1 ProcessDefinitionEntity (org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)1 TaskEntity (org.activiti.engine.impl.persistence.entity.TaskEntity)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1