Package com.google.gwt.json.client

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


      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

      userPrefs.parseDefaultValues(gadget.get("userPrefs").isObject());
    }
    JSONObject gadgetViews = getJsonObjectValue(gadget, "views");
    if (gadgetViews != null) {
      View lastView = null;
      for (String viewName : gadgetViews.keySet()) {
        JSONObject viewJson = gadgetViews.get(viewName).isObject();
        View v = new View();
        v.type = viewName;
        v.preferredHeight = getJsonLongValue(viewJson, "preferredHeight");
        v.preferredWidth = getJsonLongValue(viewJson, "preferredWidth");
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

  public Map<String,Object> readMap(final JSONValue jsonValue) {
    final Map<String,Object> map = new HashMap<String,Object>();
    if (null != jsonValue) {
      final JSONObject object = jsonValue.isObject();
      final Iterator<String> keys = object.keySet().iterator();
      while (keys.hasNext()) {
        final String key = (String) keys.next();
        final JSONValue value = (JSONValue) object.get(key);

        final Object mapValue = this.readObject(value);
View Full Code Here

            retval.setInputs(getIOData(json.get("inputs").isArray()));
            retval.setOutputs(getIOData(json.get("outputs").isArray()));
            Map<String, String> metaData = new HashMap<String, String>();
            JSONObject jsonMetaData = json.get("metaData") == null ? null : json.get("metaData").isObject();
            if (jsonMetaData != null) {
                for (String key : jsonMetaData.keySet()) {
                    metaData.put(key, jsonMetaData.get(key).isString().stringValue());
                }
            }
            retval.setMetaData(metaData);
            if (json.get("packageName") != null && json.get("packageName").isString() != null) {
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(NUM_VALUE) != null) {
              arr.set(i, arr.get(i).isObject().get(NUM_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

        rpcProxy.rpcCall("get_preconfig", params, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                JSONObject config = result.isObject();
                Map<String, String> map = new HashMap<String, String>();
                for (String key : config.keySet()) {
                    map.put(key, Utils.jsonToString(config.get(key)));
                }
                listener.handlePreconfig(map);
            }
        });
View Full Code Here

        }
        hostSelector.setSelectedHostnames(hostnames, profiles, true);

        JSONObject metaHostCounts = cloneObject.get("meta_host_counts").isObject();

        for (String label : metaHostCounts.keySet()) {
            String number = Integer.toString(
                (int) metaHostCounts.get(label).isNumber().doubleValue());
            hostSelector.addMetaHosts(label, number);
        }
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.