Examples of JsonWrapper


Examples of net.socialgamer.cah.JsonWrapper

    if (text == null || text.isEmpty()) {
      return options;
    }

    final JsonWrapper json = new JsonWrapper(text);

    final String[] cardSetsParsed = json.getString(GameOptionData.CARD_SETS, "").split(",");
    for (final String cardSetId : cardSetsParsed) {
      if (!cardSetId.isEmpty()) {
        options.cardSetIds.add(Integer.parseInt(cardSetId));
      }
    }

    options.blanksInDeck = Math.max(MIN_BLANK_CARD_LIMIT, Math.min(MAX_BLANK_CARD_LIMIT,
        json.getInteger(GameOptionData.BLANKS_LIMIT, options.blanksInDeck)));
    options.playerLimit = Math.max(MIN_PLAYER_LIMIT, Math.min(MAX_PLAYER_LIMIT,
        json.getInteger(GameOptionData.PLAYER_LIMIT, options.playerLimit)));
    options.spectatorLimit = Math.max(MIN_SPECTATOR_LIMIT, Math.min(MAX_SPECTATOR_LIMIT,
        json.getInteger(GameOptionData.SPECTATOR_LIMIT, options.spectatorLimit)));
    options.scoreGoal = Math.max(MIN_SCORE_LIMIT, Math.min(MAX_SCORE_LIMIT,
        json.getInteger(GameOptionData.SCORE_LIMIT, options.scoreGoal)));
    options.useIdleTimer = json.getBoolean(GameOptionData.USE_TIMER, options.useIdleTimer);
    options.password = json.getString(GameOptionData.PASSWORD, options.password);

    return options;
  }
View Full Code Here

Examples of org.jboss.bpm.console.client.util.JSONWalk.JSONWrapper

    if (root instanceof JSONArray) {
        JSONArray array = (JSONArray) root;
       
        for (int i = 0; i < array.size(); i++) {
            JSONWalk walk = JSONWalk.on(array.get(i));
            JSONWrapper wrapper = walk.next("activeNode");
            JSONObject activeNode = wrapper.asObject();
       
            int x = JSONWalk.on(activeNode).next("x").asInt();
            int y = JSONWalk.on(activeNode).next("y").asInt();
       
            int width = JSONWalk.on(activeNode).next("width").asInt();
View Full Code Here

Examples of org.jboss.bpm.console.client.util.JSONWalk.JSONWrapper

    if (root instanceof JSONArray) {
        JSONArray array = (JSONArray) root;
       
        for (int i = 0; i < array.size(); i++) {
            JSONWalk walk = JSONWalk.on(array.get(i));
            JSONWrapper wrapper = walk.next("activeNode");
            JSONObject activeNode = wrapper.asObject();
       
            int x = JSONWalk.on(activeNode).next("x").asInt();
            int y = JSONWalk.on(activeNode).next("y").asInt();
       
            int width = JSONWalk.on(activeNode).next("width").asInt();
View Full Code Here

Examples of org.jboss.bpm.console.client.util.JSONWalk.JSONWrapper

    if (root instanceof JSONArray) {
      JSONArray array = (JSONArray) root;
      List<ActiveNodeInfo> activeNodeInfos = new ArrayList<ActiveNodeInfo>();
      for (int i = 0; i < array.size(); i++) {
        JSONWalk walk = JSONWalk.on(array.get(i));
        JSONWrapper wrapper = walk.next("activeNode");
        JSONObject activeNode = wrapper.asObject();
   
        int x = JSONWalk.on(activeNode).next("x").asInt();
        int y = JSONWalk.on(activeNode).next("y").asInt();
   
        int width = JSONWalk.on(activeNode).next("width").asInt();
View Full Code Here

Examples of org.springframework.batch.admin.web.JsonWrapper

    model.put("baseUrl", "http://localhost:8080/springsource");
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("\"duration\" : \"\""));
    JsonWrapper wrapper = new JsonWrapper(content);
    assertEquals("STARTING", wrapper.get("jobExecution.status"));
    assertEquals(2, wrapper.get("jobExecution.stepExecutions", Map.class).size());
    assertEquals("http://localhost:8080/springsource/jobs/executions/123/steps/1235.json", wrapper
        .get("jobExecution.stepExecutions.bar.resource"));
  }
View Full Code Here

Examples of org.springframework.batch.admin.web.JsonWrapper

    model.put("baseUrl", "http://localhost:8080/springsource");
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    assertTrue(content.contains("\"duration\" : \"\""));
    JsonWrapper wrapper = new JsonWrapper(content);
    assertEquals("STARTING", wrapper.get("jobExecution.status"));
    assertEquals(2, wrapper.get("jobExecution.stepExecutions", Map.class).size());
    assertEquals("http://localhost:8080/springsource/jobs/executions/123/steps/1234.json", wrapper
        .get("jobExecution.stepExecutions.foo.resource"));
  }
View Full Code Here

Examples of org.springframework.batch.admin.web.JsonWrapper

    model.put("files", Arrays.asList(new FileInfo("foo"), new FileInfo("bar")));
    model.put("baseUrl", "http://localhost:8080/springsource");
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    JsonWrapper wrapper = new JsonWrapper(content);
    assertEquals(2, wrapper.get("files.uploaded", Map.class).size());
  }
View Full Code Here

Examples of org.springframework.batch.admin.web.JsonWrapper

        TimeZone.getTimeZone("GMT")));
    view.render(model, request, response);
    String content = response.getContentAsString();
    //    System.err.println(content);
    assertTrue(content.contains("jobInstance"));
    JsonWrapper wrapper = new JsonWrapper(content);
    assertEquals(3, wrapper.get("jobInstance", Map.class).size());
  }
View Full Code Here

Examples of org.springframework.batch.admin.web.JsonWrapper

        new JobExecutionInfo(jobExecution2, TimeZone.getTimeZone("GMT"))));
    model.put("currentTime", new Date());
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    JsonWrapper wrapper = new JsonWrapper(content);
    assertEquals(2, wrapper.get("jobExecutions", Map.class).size());
  }
View Full Code Here

Examples of org.springframework.batch.admin.web.JsonWrapper

    model.put("nextJobExecution", 31);
    model.put("previousJobExecution", 21);
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    JsonWrapper wrapper = new JsonWrapper(content);
    assertEquals(2, wrapper.get("jobExecutions", Map.class).size());
    assertEquals(5, wrapper.get("page", Map.class).size());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.