示例#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;
 }
示例#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;
  }
示例#3
0
 public List<QueryMetric> parseQueryMetric(String json)
     throws QueryException, BeanValidationException {
   JsonParser parser = new JsonParser();
   JsonObject obj = parser.parse(json).getAsJsonObject();
   return parseQueryMetric(obj);
 }