Package org.json

Examples of org.json.JSONObject.opt()


  ArrayList<Album> albumList = new ArrayList<Album>();
  ArrayList<Profile> profileList = new ArrayList<Profile>();

  // handle posts
  try {
      Object postListObj = root.opt("posts");
      if (postListObj != null && postListObj instanceof JSONArray) {
    JSONArray posts = (JSONArray) postListObj;
    int postSize = posts.length();
    for (int a = 0; a < postSize; a++) {
        JSONObject jObj = posts.getJSONObject(a);
View Full Code Here


    String propertyName = selector.get(index);
    Object value = null;
   
    if( doc instanceof JSONObject ) {
      JSONObject jsonObj = (JSONObject)doc;
      value = jsonObj.opt(propertyName);
      if( null != value
       && index < (selector.size()-1) ) {
        value = select(value, index+1);
      }
    }
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.