Exemplo n.º 1
0
 public RollupTask parseRollupTask(String json) throws BeanValidationException, QueryException {
   JsonParser parser = new JsonParser();
   JsonObject taskObject = parser.parse(json).getAsJsonObject();
   RollupTask task = parseRollupTask(taskObject, "");
   task.addJson(taskObject.toString().replaceAll("\\n", ""));
   return task;
 }
Exemplo n.º 2
0
  public List<RollupTask> parseRollupTasks(String json)
      throws BeanValidationException, QueryException {
    List<RollupTask> tasks = new ArrayList<RollupTask>();
    JsonParser parser = new JsonParser();
    JsonArray rollupTasks = parser.parse(json).getAsJsonArray();
    for (int i = 0; i < rollupTasks.size(); i++) {
      JsonObject taskObject = rollupTasks.get(i).getAsJsonObject();
      RollupTask task = parseRollupTask(taskObject, "tasks[" + i + "]");
      task.addJson(taskObject.toString().replaceAll("\\n", ""));
      tasks.add(task);
    }

    return tasks;
  }