Package org.json

Examples of org.json.JSONObject.keys()


    if (match == 0) {
      throw new UnmarshallException("bean has no matches");
    }

    ObjectMatch m = null, tmp;
    i = jso.keys();
    while (i.hasNext()) {
      String field = (String) i.next();
      Method setMethod = bd.writableProps.get(field);
      if (setMethod != null) {
        try {
View Full Code Here


      log.error(e.getMessage(), e);
      throw new UnmarshallException("can't instantiate bean " + clazz.getName() + ": " + e.getMessage());
    }
    Object[] invokeArgs = new Object[1];
    Object fieldVal;
    Iterator i = jso.keys();
    while (i.hasNext()) {
      String field = (String) i.next();
      Method setMethod = bd.writableProps.get(field);
      if (setMethod != null) {
        try {
View Full Code Here

    if (StringUtils.isEmpty(attributes)) {
      return;
    }
    try {
      JSONObject obj = new JSONObject(attributes);
      Iterator<String> attributeIter = obj.keys();
      while (attributeIter.hasNext()) {
        String attrName = attributeIter.next();
        if (!data.containsKey(attrName)) {
          data.put(attrName, new HashMap<String, String>());
        }
View Full Code Here

        String attrName = attributeIter.next();
        if (!data.containsKey(attrName)) {
          data.put(attrName, new HashMap<String, String>());
        }
        JSONObject attr = obj.getJSONObject(attrName);
        Iterator<String> langIter = attr.keys();
        while (langIter.hasNext()) {
          String language = langIter.next();
          data.get(attrName).put(language, attr.getString(language));
        }
      }
View Full Code Here

  private void parseTitle() {
    titles = new HashMap<String, String>();
    if (title != null) {
      try {
        JSONObject obj = new JSONObject(getTitleValue());
        Iterator<String> it = obj.keys();
        while (it.hasNext()) {
          String key = it.next();
          titles.put(key, obj.getString(key));
        }
      } catch (org.json.JSONException e) {
View Full Code Here

    if (StringUtils.isEmpty(attributesJSON)) {
      return;
    }
    try {
      JSONObject obj = new JSONObject(attributesJSON);
      Iterator<String> attributeIter = obj.keys();
      while (attributeIter.hasNext()) {
        String attrName = attributeIter.next();
        getAttributes().put(attrName, obj.getString(attrName));
      }
    } catch (org.json.JSONException e) {
View Full Code Here

        public void deserializeData() {
            try {
                Map<String, String> data = new HashMap<String, String>();
                if (StringUtils.isNotBlank(serializedData)) {
                    JSONObject jsonObject = new JSONObject(serializedData);
                    Iterator keys = jsonObject.keys();
                    while (keys.hasNext()) {
                        String key = (String) keys.next();
                        data.put(key, (String) jsonObject.get(key));
                    }
                }
View Full Code Here

        public void deserializeData() {
            try {
                Map<String, String> data = new HashMap<String, String>();
                if (StringUtils.isNotBlank(serializedData)) {
                    JSONObject jsonObject = new JSONObject(serializedData);
                    Iterator keys = jsonObject.keys();
                    while (keys.hasNext()) {
                        String key = (String) keys.next();
                        data.put(key, (String) jsonObject.get(key));
                    }
                }
View Full Code Here

                resource.addProperty(Repository.JCR_PRIMARY_TYPE, primaryType);
            }

            // TODO - populate all properties

            for (Iterator<?> keyIterator = json.keys(); keyIterator.hasNext();) {

                String key = (String) keyIterator.next();
                JSONObject value = json.optJSONObject(key);
                if (value != null) {
                    ResourceProxy child = new ResourceProxy(PathUtil.join(path, key));
View Full Code Here

    ObjectMapper mapper = new ObjectMapper();

      try
      {
        JSONObject obj2 = new JSONObject(s);
        Iterator<String> itr = obj2.keys();
        while (itr.hasNext())
        {
          String k = itr.next();
          Long key = Long.valueOf(k);
          genericMap.put(key, obj2.getJSONObject(key.toString()));
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.