Package org.json

Examples of org.json.JSONObject.optJSONArray()


                        FilterOperator.EQUAL, externalBloggingSystem);


        try {
            final JSONObject result = get(query);
            final JSONArray array = result.optJSONArray(Keys.RESULTS);

            if (0 == array.length()) {
                return null;
            }
View Full Code Here


    }
    List<com.belerweb.social.weixin.bean.Menu> menus =
        new ArrayList<com.belerweb.social.weixin.bean.Menu>();
    JSONObject menu = jsonObject.optJSONObject("menu");
    if (menu != null) {
      menus = Result.parse(menu.optJSONArray("button"), com.belerweb.social.weixin.bean.Menu.class);
    }
    return new Result<List<com.belerweb.social.weixin.bean.Menu>>(menus);
  }

  /**
 
View Full Code Here

    }
    List<com.belerweb.social.weixin.bean.Menu> menus =
        new ArrayList<com.belerweb.social.weixin.bean.Menu>();
    JSONObject menu = jsonObject.optJSONObject("menu");
    if (menu != null) {
      menus = Result.parse(menu.optJSONArray("button"), com.belerweb.social.weixin.bean.Menu.class);
    }
    return new Result<List<com.belerweb.social.weixin.bean.Menu>>(menus);
  }

  /**
 
View Full Code Here

        if (r != null && r.isSuccess()) {
            JSONObject props;
            Collection<String> keys;
            if (!r.isStreamed()) {
                JSONObject json = new JSONObject(r.getBodyAsString());
                JSONArray jsonKeys = json.optJSONArray(Constants.FL_KEYS);
                props = json.optJSONObject(Constants.FL_SCHEMA);
                keys = ClientUtils.jsonArrayAsList(jsonKeys);
            } else {
                InputStream stream = r.getStream();
                JSONTokener tokens = new JSONTokener(new InputStreamReader(stream));
View Full Code Here

    String userName = null;
    if( null != userDocContext ){
      JSONObject userDoc = userDocContext.getUserDoc();
     
      Set<String> validatedEmails = new HashSet<String>();
      JSONArray jsonValidated = userDoc.optJSONArray("nunaliit_validated_emails");
      if( null != jsonValidated ){
        for(int i=0; i<jsonValidated.length(); ++i){
          String email = jsonValidated.getString(i);
          validatedEmails.add(email);
        }
View Full Code Here

          String email = jsonValidated.getString(i);
          validatedEmails.add(email);
        }
      }
     
      JSONArray jsonEmails = userDoc.optJSONArray("nunaliit_emails");
      if( null != jsonEmails ){
        for(int i=0; i<jsonEmails.length(); ++i){
          String email = jsonEmails.getString(i);
          if( validatedEmails.contains(email) ){
            emails.add(email);
View Full Code Here

        keys = new ArrayList<String>();

        if (r != null && r.isSuccess()) {
            Collection<String> b;
            JSONObject json = new JSONObject(r.getBodyAsString());
            JSONArray k = json.optJSONArray(Constants.FL_KEYS);
            b = ClientUtils.jsonArrayAsList(k);
            keys.addAll(b);
        }
    }
View Full Code Here

        buckets = new HashSet<String>();

        if (r != null && r.isSuccess()) {
            Collection<String> b;
            JSONObject json = new JSONObject(r.getBodyAsString());
            JSONArray jsonBuckets = json.optJSONArray(Constants.FL_BUCKETS);
            b = ClientUtils.jsonArrayAsList(jsonBuckets);
            buckets.addAll(b);
        }
    }
View Full Code Here

        if (r != null && r.isSuccess()) {
            JSONObject props;
            Collection<String> keys;
            if (!r.isStreamed()) {
                JSONObject json = new JSONObject(r.getBodyAsString());
                JSONArray jsonKeys = json.optJSONArray(Constants.FL_KEYS);
                props = json.optJSONObject(Constants.FL_SCHEMA);
                keys = ClientUtils.jsonArrayAsList(jsonKeys);
            } else {
                InputStream stream = r.getStream();
                JSONTokener tokens = new JSONTokener(new InputStreamReader(stream));
View Full Code Here

     
      //1) add the node name
      rowNodes.add(cell);
     
      //2) add the child node names
      childs = aNode.optJSONArray(CrossTab.CROSSTAB_NODE_JSON_CHILDS);
        if (childs != null && childs.length() > 0) {
          rowNodes.addAll(buildRowsHeaders(childs));
        }else{
          rowNodes.addAll(dataMatrix.remove(0));
        }
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.