Package org.camunda.bpm.engine.impl.util.json

Examples of org.camunda.bpm.engine.impl.util.json.JSONArray


  @Test
  @SuppressWarnings("unchecked")
  public void testJsonArrayToList() {
    assertNull(jsonArrayAsList(null));

    JSONArray jsonArray = new JSONArray();

    List<Object> list = jsonArrayAsList(jsonArray);
    assertTrue(list.isEmpty());

    jsonArray.put(true);
    jsonArray.put(12);
    jsonArray.put(11.1);
    jsonArray.put(13l);
    jsonArray.put("test");
    jsonArray.put(Collections.singletonList("test"));
    jsonArray.put(Collections.singletonMap("test", "test"));
    jsonArray.put(new Date(0));

    list = jsonArrayAsList(jsonArray);
    assertEquals(8, list.size());

    assertEquals(true, list.get(0));
View Full Code Here


    }
  }

  protected void addListField(JSONObject json, String name, List<String> list) {
    if (list != null) {
      json.put(name, new JSONArray(list));
    }
  }
View Full Code Here

      }
    }
  }

  protected void addVariable(JSONObject json, String variableType, TaskQueryVariableValue variable) {
    JSONArray array = json.optJSONArray(variableType);
    if (array == null) {
      array = new JSONArray();
    }
    addVariable(array, variable);
    json.put(variableType, array);
  }
View Full Code Here

    }
  }

  protected void addListField(JSONObject json, String name, List<String> list) {
    if (list != null) {
      json.put(name, new JSONArray(list));
    }
  }
View Full Code Here

      }
    }
  }

  protected void addVariable(JSONObject json, String variableType, TaskQueryVariableValue variable) {
    JSONArray array = json.optJSONArray(variableType);
    if (array == null) {
      array = new JSONArray();
    }
    addVariable(array, variable);
    json.put(variableType, array);
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.util.json.JSONArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.