Package com.google.gwt.json.client

Examples of com.google.gwt.json.client.JSONObject.keySet()


    JSONArray arr;

    if ((obj = val.isObject()) != null) {
      obj.put(OBJECT_ID, new JSONString(new Integer(++objectId[0]).toString()));

      for (String k : obj.keySet()) {
        fromJackson(obj.get(k), k, obj, objectId);
      }
    }
    else if ((num = val.isNumber()) != null) {
      JSONObject numObject = new JSONObject();
View Full Code Here


        TextResource compat = TextResources.INSTANCE.compat();

        JSONValue root = JSONParser.parseLenient(compat.getText());
        JSONObject versionList = root.isObject();
        Set<String> keys = versionList.keySet();
        for(String key : keys)
        {
            modelVersions.put(key, versionList.get(key).isString().stringValue());
        }
View Full Code Here

      throw new SparqlEmptyException("No results");
    }
    //Loop through binding array
    for (int i = 0; i < bindingsArray.size(); i++) {
      JSONObject bindingObject = getAsObject(bindingsArray.get(i));
      Set<String> keys = bindingObject.keySet();
      Iterator<String> keysIterator = keys.iterator();
      HashMap<String, HashMap<String, String>> bindingHashMap = new HashMap<String, HashMap<String, String>>();
      //get binding into hashmap (binding is: variabled => node-info json object
      while (keysIterator.hasNext()) {
        String variable = keysIterator.next();
View Full Code Here

      HashMap<String, HashMap<String, String>> bindingHashMap = new HashMap<String, HashMap<String, String>>();
      //get binding into hashmap (binding is: variabled => node-info json object
      while (keysIterator.hasNext()) {
        String variable = keysIterator.next();
        JSONObject node = getAsObject(bindingObject.get(variable));
        Set<String> nodeKeys = node.keySet();
        Iterator<String> nodeIterator = nodeKeys.iterator();
        HashMap<String, String> nodeHashMap = new HashMap<String, String>();
        while (nodeIterator.hasNext()) {
          String nodeKey = nodeIterator.next();
          String nodeValue = node.get(nodeKey).isString().stringValue();
View Full Code Here

  protected Map<String, Boolean> getMap(String key, Map<String, Boolean> defaultVal) {
    Map<String, Boolean> value = defaultVal;
    if (containsKey(key) && get(key).isObject() != null){
      value = new HashMap<String, Boolean>();
      JSONObject jsonObject = get(key).isObject();
      Set<String> keySet = jsonObject.keySet();
      for (String objKey: keySet) {
        if (jsonObject.get(objKey).isBoolean() != null) {
          value.put(objKey, jsonObject.get(objKey).isBoolean().booleanValue());
        }
      }
View Full Code Here

          String value = null;
          if (argObject.containsKey("key") && argObject.containsKey("value")) {
            key = argObject.get("key").isString().stringValue();
            value = argObject.get("value").isString().stringValue();
          } else {
            Set<String> keySet = argObject.keySet();
            for (String arrayKey: keySet) {
              key = arrayKey;
              value = argObject.get(arrayKey).isString().stringValue();
            }
          }
View Full Code Here

      JSONValue encType = obj.get(ENCODED_TYPE);
      obj.put(OBJECT_ID, null);
      obj.put(ENCODED_TYPE, null);

      for (String k : obj.keySet()) {
        JSONArray arr;
        if ((arr = obj.get(k).isArray()) != null) {
          for (int i = 0; i < arr.size(); i++) {
            if (arr.get(i).isObject() != null && arr.get(i).isObject().get(NUMERIC_VALUE) != null) {
              arr.set(i, arr.get(i).isObject().get(NUMERIC_VALUE));
View Full Code Here

    JSONArray arr;

    if ((obj = val.isObject()) != null) {
      obj.put(OBJECT_ID, new JSONString(new Integer(++objectId[0]).toString()));

      for (String k : obj.keySet()) {
        fromJackson(obj.get(k), k, obj, objectId);
      }
    }
    else if ((num = val.isNumber()) != null) {
      JSONObject numObject = new JSONObject();
View Full Code Here

    list.add(decode(array.get(ct)));
      return list;
  } else if (value instanceof JSONObject) {
      JSONObject object = value.isObject();
      Map<String, Object> map = new HashMap<String, Object>();
      for (String key : object.keySet())
    map.put(key, decode(object.get(key)));
      return map;
  } else
      return null;
    }
View Full Code Here

    private Multimap<HttpMethod, RestParameter> decodeParameters(String encodedParameters) {
        Multimap<HttpMethod, RestParameter> parameters = LinkedHashMultimap.create();

        JSONObject json = JSONParser.parseStrict(encodedParameters).isObject();
        for (String method : json.keySet()) {
            HttpMethod httpMethod = HttpMethod.valueOf(method);
            JSONArray jsonParameters = json.get(method).isArray();

            for (int i = 0; i < jsonParameters.size(); ++i) {
                JSONObject jsonParameter = jsonParameters.get(i).isObject();
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.