Examples of JSONValue


Examples of com.google.gwt.json.client.JSONValue

    JSONNumber num = getNumber(key);
    return num == null ? null : new Integer((int) num.doubleValue());
  }

  protected String getString(String key) {
    JSONValue value = get(key);
    if (value == null) {
      return null;
    }
    JSONString str = value.isString();
    return str == null ? null : str.stringValue();
  }
View Full Code Here

Examples of com.google.gwt.json.client.JSONValue

    JSONString str = value.isString();
    return str == null ? null : str.stringValue();
  }

  protected JSONNumber getNumber(String key) {
    JSONValue val = get(key);
    if (val == null) {
      return null;
    }
    return val.isNumber();
  }
View Full Code Here

Examples of com.google.gwt.json.client.JSONValue

    }
    return val.isNumber();
  }

  protected JSONArray getArray(String key) {
    JSONValue value = get(key);
    if (value == null) {
      return null;
    }
    return value.isArray();
  }
View Full Code Here

Examples of com.google.gwt.json.client.JSONValue

    }
    return value.isArray();
  }

  protected JSONObject getObject(String key) {
    JSONValue value = get(key);
    if (value == null) {
      return null;
    }
    return value.isObject();
  }
View Full Code Here

Examples of com.google.gwt.json.client.JSONValue

     * cannot be sure the destination endpoint exists within this Errai bundle.  So we extract the ToSubject
     * field and send the unparsed JSON object onwards.
     *
     */
    try {
      JSONValue val = JSONParser.parseStrict(value);
      if (val == null) {
        return EMPTYLIST;
      }
      JSONArray arr = val.isArray();
      if (arr == null) {
        throw new RuntimeException("unrecognized payload" + val.toString());
      }
      ArrayList<MarshalledMessage> list = new ArrayList<MarshalledMessage>(arr.size());
      for (int i = 0; i < arr.size(); i++) {
        list.add(new MarshalledMessageImpl((JSONObject) arr.get(i)));
      }
View Full Code Here

Examples of com.google.json.serialization.JsonValue

      public void postProcess() {
      }

      public void visit(JsonObject node) throws JsonException {
        JsonValue valueNode = node.get("value");
        assertNotNull(valueNode);
        long value = valueNode.asNumber().getInteger();
        assertEquals(curr + 1, value);
        curr++;
      }
    });
  }
View Full Code Here

Examples of com.hazelcast.com.eclipsesource.json.JsonValue

    private JsonUtil() {
    }

    public static int getInt(JsonObject object, String field) {
        final JsonValue value = object.get(field);
        throwExceptionIfNull(value, field);
        return value.asInt();
    }
View Full Code Here

Examples of com.sdicons.json.model.JSONValue

  private Result parseResponseJSON(InputStream response) throws Exception {
    try {
      Result results = new Result();
      int cont = 0;
      JSONParser parser = new JSONParser(response);
      JSONValue jsonObject = parser.nextValue();
      if (jsonObject.isComplex()) {

        JSONObject complex = (JSONObject) jsonObject;
        JSONObject jsonResults = (JSONObject) complex.get("results");
        JSONArray bindings = (JSONArray) jsonResults.get("bindings");
        for (int i = 0; i < bindings.getValue().size(); i++) {
View Full Code Here

Examples of com.serotonin.json.type.JsonValue

    @Override
    public void jsonRead(JsonReader reader, JsonObject jsonObject) throws JsonException {
        super.jsonRead(reader, jsonObject);

        JsonValue jsonImageId = jsonObject.get("dynamicImage");
        if (jsonImageId != null) {
            String id = jsonImageId.toString();
            dynamicImage = Common.getDynamicImage(id);
            if (dynamicImage == null)
                throw new TranslatableJsonException("emport.error.component.unknownDynamicImage", id,
                        Common.getDynamicImageIds());
        }
View Full Code Here

Examples of com.serotonin.json.type.JsonValue

    @Override
    public void jsonRead(JsonReader reader, JsonObject jsonObject) throws JsonException {
        super.jsonRead(reader, jsonObject);

        JsonValue jsonImageId = jsonObject.get("imageSet");
        if (jsonImageId != null) {
            String id = jsonImageId.toString();
            imageSet = Common.getImageSet(id);
            if (imageSet == null)
                throw new TranslatableJsonException("emport.error.component.unknownImageSet", id,
                        Common.getImageSetIds());
        }
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.