Package org.json

Examples of org.json.JSONObject.optJSONArray()


    String filters;

    try {
      scannerDescriptor = new JSONObject(new String(input));

      columnArray = scannerDescriptor.optJSONArray(RESTConstants.COLUMNS);
      timestamp = scannerDescriptor.optLong(RESTConstants.SCANNER_TIMESTAMP);
      startRow = Bytes.toBytes(scannerDescriptor.optString(
          RESTConstants.SCANNER_START_ROW, ""));
      stopRow = Bytes.toBytes(scannerDescriptor.optString(
          RESTConstants.SCANNER_STOP_ROW, ""));
View Full Code Here


            if (null != item && item.has(ITEMS)) {
                if (item.optString(fieldName).equalsIgnoreCase(fieldValue)) {
                    result = item;
                    break;
                } else {
                    result = this.getGroup(item.optJSONArray(ITEMS),
                            fieldName, fieldValue);
                    if (null != result) {
                        break;
                    }
                }
View Full Code Here

                        FilterOperator.EQUAL, true);
        query.setCurrentPageNum(1);
        query.setPageSize(fetchSize);

        final JSONObject result1 = get(query);
        final JSONArray array1 = result1.optJSONArray(Keys.RESULTS);

        try {
            final List<JSONObject> list1 =
                    CollectionUtils.<JSONObject>jsonArrayToList(array1);
            ret.addAll(list1);
View Full Code Here

                                FilterOperator.EQUAL, true);
                query.setCurrentPageNum(1);
                query.setPageSize(reminingSize);

                final JSONObject result2 = get(query);
                final JSONArray array2 = result2.optJSONArray(Keys.RESULTS);

                final List<JSONObject> list2 =
                        CollectionUtils.<JSONObject>jsonArrayToList(array2);
                ret.addAll(list2);
            }
View Full Code Here

        final Query query = new Query();
        query.addFilter(Article.ARTICLE + "_" + Keys.OBJECT_ID,
                        FilterOperator.EQUAL, articleId);

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

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

            return ret;
        }

        try {
            final JSONObject result = tagRepository.get(new Query());
            final JSONArray tagArray = result.optJSONArray(Keys.RESULTS);
            if (null != tagArray) {
                ret = tagArray;
            }
        } catch (final RepositoryException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

        final Query query = new Query();
        query.addFilter(Comment.COMMENT + "_" + Keys.OBJECT_ID,
                        FilterOperator.EQUAL, commentId);
       
        final JSONObject result = get(query);
        final JSONArray array = result.optJSONArray(Keys.RESULTS);
        if (0 == array.length()) {
            return null;
        }
       
        return array.optJSONObject(0);
View Full Code Here

                        externalArticleId);
        query.addFilter(BlogSync.BLOG_SYNC_EXTERNAL_BLOGGING_SYS,
                        FilterOperator.EQUAL, externalBloggingSys);

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

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

    public int getMaxOrder() throws RepositoryException {
        final Query query = new Query();
        query.addSort(Link.LINK_ORDER, SortDirection.DESCENDING);

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

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

    @Override
    public int getMaxOrder() throws RepositoryException {
        final Query query = new Query();
        query.addSort(Page.PAGE_ORDER, SortDirection.DESCENDING);
        final JSONObject result = get(query);
        final JSONArray array = result.optJSONArray(Keys.RESULTS);

        if (0 == array.length()) {
            return -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.