Examples of toJson()


Examples of org.scotlandyard.engine.json.GamePlayersJsonContainer.toJson()

    gpjc.detectives=new ArrayList<JsonPlayer>();
    for(Detective d:game.getDetectives()){
      gpjc.detectives.add(getJsonPlayer(d, game));
    }

    return (gpjc.toJson());

  }

  public JsonPlayer getJsonPlayer(Player player,Game game) throws GameException{
    JsonPlayer jsonPlayer = new JsonPlayer();
View Full Code Here

Examples of org.scotlandyard.engine.json.GamesJsonContainer.toJson()

    gjc.games=new ArrayList<String>();
    for(Game game:GameEngine.instance().getLobby().getAvailableGames()){
      gjc.games.add(game.getIdentifier());
    }

    return (gjc.toJson());
    }

  @Override
  public void validateRequest(
      final HttpServletRequest request,
View Full Code Here

Examples of org.scotlandyard.engine.json.UsersJsonContainer.toJson()

    assertEquals(
        "check if the number of users in the container is two",
        2,
        ujc.users.size()
        );
    final String json = ujc.toJson();
    //System.out.println(json);
    assertTrue(
        "check if the number of users json string has email and name",
        json.contains("\"email1\"") &&
        json.contains("\"email2\"") &&
View Full Code Here

Examples of org.sonar.batch.protocol.input.GlobalReferentials.toJson()

      GlobalReferentials ref = new GlobalReferentials();
      addMetrics(ref, session);
      addSettings(ref, hasScanPerm, hasDryRunPerm, session);

      response.stream().setMediaType(MimeTypes.JSON);
      IOUtils.write(ref.toJson(), response.stream().output());
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

Examples of org.sonar.batch.protocol.input.ProjectReferentials.toJson()

      addProfiles(ref, projectKey, profileName, session);
      addActiveRules(ref);

      response.stream().setMediaType(MimeTypes.JSON);
      IOUtils.write(ref.toJson(), response.stream().output());
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

Examples of org.springside.modules.mapper.JsonMapper.toJson()

  public void threeTypeInclusion() {
    TestBean bean = new TestBean("A");

    // 打印全部属性
    JsonMapper normalMapper = new JsonMapper();
    assertThat(normalMapper.toJson(bean)).isEqualTo(
        "{\"name\":\"A\",\"defaultValue\":\"hello\",\"nullValue\":null}");

    // 不打印nullValue属性
    JsonMapper nonEmptyMapper = JsonMapper.nonEmptyMapper();
    assertThat(nonEmptyMapper.toJson(bean)).isEqualTo("{\"name\":\"A\",\"defaultValue\":\"hello\"}");
View Full Code Here

Examples of org.springside.modules.utils.encode.JsonBinder.toJson()

  @Test
  public void threeTypeBinders() {
    //打印全部属性
    JsonBinder normalBinder = JsonBinder.buildNormalBinder();
    TestBean bean = new TestBean("A");
    assertEquals("{\"nullValue\":null,\"name\":\"A\",\"defaultValue\":\"hello\"}", normalBinder.toJson(bean));

    //不打印nullValue属性
    JsonBinder nonNullBinder = JsonBinder.buildNonNullBinder();
    assertEquals("{\"name\":\"A\",\"defaultValue\":\"hello\"}", nonNullBinder.toJson(bean));
View Full Code Here

Examples of org.timepedia.chronoscope.client.Datasets.toJson()

      dsets.add(d);
    }
   
    String mippedJson;
    if (multiple) {
      mippedJson = dsets.toJson();
    } else {
      mippedJson = dsets.get(0).toJson();
    }
   
    if (varName != null) {
View Full Code Here

Examples of org.uengine.ui.flowchart.impl.MakeProcessDefinitionToJSON.toJSON()

        result = mkProcessInstanceToJSON.toJSON(pm.getProcessDefinitionWithInstanceId(instanceId));
      } else {
        mkProcessDefinitionToJSON = new MakeProcessDefinitionToJSON();
        mkProcessDefinitionToJSON.setOnlyHumanActivity(onlyHumanActivity);
        if (defVerId != null) {
          result = mkProcessDefinitionToJSON.toJSON(pm.getProcessDefinition(defVerId));
        } else if (defId != null) {
          String tempDefVerId = pm.getProcessDefinitionProductionVersion(defId);
          result = mkProcessDefinitionToJSON.toJSON(pm.getProcessDefinition(tempDefVerId));
        }
      }
View Full Code Here

Examples of org.uengine.ui.flowchart.impl.MakeProcessInstanceToJSON.toJSON()

     
      if (instanceId != null) {
        mkProcessInstanceToJSON = new MakeProcessInstanceToJSON(pm.getProcessInstance(instanceId));
        mkProcessInstanceToJSON.setOnlyHumanActivity(onlyHumanActivity);
        mkProcessInstanceToJSON.setPm(pm);
        result = mkProcessInstanceToJSON.toJSON(pm.getProcessDefinitionWithInstanceId(instanceId));
      } else {
        mkProcessDefinitionToJSON = new MakeProcessDefinitionToJSON();
        mkProcessDefinitionToJSON.setOnlyHumanActivity(onlyHumanActivity);
        if (defVerId != null) {
          result = mkProcessDefinitionToJSON.toJSON(pm.getProcessDefinition(defVerId));
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.