Package org.json

Examples of org.json.JSONObject.optJSONArray()


    Map<String, String> idNameMap = new HashMap<String, String>();
    Map<String, String> nameIdMap = new HashMap<String, String>();
    try{
        JSONObject formState = (JSONObject) getProperty(FORM_STATE);
        if(formState!=null && formState.length()!=0){
          JSONArray staticOpenFilters = formState.optJSONArray("staticOpenFilters");
          fillMaps(staticOpenFilters, idNameMap, nameIdMap, "id", "text","staticOpenFilters");
          JSONArray dynamicFilters = formState.optJSONArray("dynamicFilters");
          fillMaps(dynamicFilters, idNameMap, nameIdMap, "id", "title","dynamicFilters");
          JSONArray staticClosedFilters = formState.optJSONArray("staticClosedFilters");
          fillMaps(staticClosedFilters, idNameMap, nameIdMap, "id", "title","staticClosedFilters");
View Full Code Here


    try{
        JSONObject formState = (JSONObject) getProperty(FORM_STATE);
        if(formState!=null && formState.length()!=0){
          JSONArray staticOpenFilters = formState.optJSONArray("staticOpenFilters");
          fillMaps(staticOpenFilters, idNameMap, nameIdMap, "id", "text","staticOpenFilters");
          JSONArray dynamicFilters = formState.optJSONArray("dynamicFilters");
          fillMaps(dynamicFilters, idNameMap, nameIdMap, "id", "title","dynamicFilters");
          JSONArray staticClosedFilters = formState.optJSONArray("staticClosedFilters");
          fillMaps(staticClosedFilters, idNameMap, nameIdMap, "id", "title","staticClosedFilters");
        }
    }catch (Exception e){
View Full Code Here

        if(formState!=null && formState.length()!=0){
          JSONArray staticOpenFilters = formState.optJSONArray("staticOpenFilters");
          fillMaps(staticOpenFilters, idNameMap, nameIdMap, "id", "text","staticOpenFilters");
          JSONArray dynamicFilters = formState.optJSONArray("dynamicFilters");
          fillMaps(dynamicFilters, idNameMap, nameIdMap, "id", "title","dynamicFilters");
          JSONArray staticClosedFilters = formState.optJSONArray("staticClosedFilters");
          fillMaps(staticClosedFilters, idNameMap, nameIdMap, "id", "title","staticClosedFilters");
        }
    }catch (Exception e){
      logger.error("Error getting the map id-->name of the form fields",e);
    }
View Full Code Here

    List<JSONObject> levelNodes = new ArrayList<JSONObject>();
   
    for (int i = 0; i < siblings.length(); i++) {
      JSONObject aNode = (JSONObject) siblings.get(i);
      levelNodes.add(aNode);
      childs = aNode.optJSONArray(CrossTab.CROSSTAB_NODE_JSON_CHILDS);
        if (childs != null && childs.length() > 0) {
          childLevelNodes.addAll(getAllNodes(childs));
        }
    }
View Full Code Here

     
      JSONArray staticClosedFilters = data.optJSONArray("staticClosedFilters");
      if (staticClosedFilters != null && staticClosedFilters.length() > 0) {
        for (int i = 0; i < staticClosedFilters.length(); i++) {
          JSONObject staticClosedFilter = staticClosedFilters.getJSONObject(i);
          JSONArray options = staticClosedFilter.optJSONArray("options");
          if (options != null && options.length() > 0) {
            for (int j = 0; j < options.length(); j++) {
              JSONObject option = options.getJSONObject(j);
              JSONArray filters = option.optJSONArray("filters");
              if (filters != null && filters.length() > 0) {
View Full Code Here

          JSONObject staticClosedFilter = staticClosedFilters.getJSONObject(i);
          JSONArray options = staticClosedFilter.optJSONArray("options");
          if (options != null && options.length() > 0) {
            for (int j = 0; j < options.length(); j++) {
              JSONObject option = options.getJSONObject(j);
              JSONArray filters = option.optJSONArray("filters");
              if (filters != null && filters.length() > 0) {
                for (int k = 0; k < filters.length(); k++) {
                  JSONObject filter = filters.getJSONObject(k);
                  convertFilter(filter);
                }
View Full Code Here

              rowsCounter + descendants - 1, //last row  (0-based)
              columnNum, //first column (0-based)
              columnNum //last column  (0-based)
          ));
        }
        JSONArray childs = aNode.optJSONArray(CrossTab.CROSSTAB_NODE_JSON_CHILDS);
        if (childs != null && childs.length() > 0) {
          buildRowsHeaders(sheet, childs, rowsCounter, columnNum + 1, createHelper);
        }
        int increment = descendants > 1 ? descendants : 1;
        rowsCounter = rowsCounter + increment;
View Full Code Here

              columnCounter + descendants - //last column  (0-based)
          ));
        }
        cell.setCellStyle(cellStyle);
       
        JSONArray childs = aNode.optJSONArray(CrossTab.CROSSTAB_NODE_JSON_CHILDS);
        if (childs != null && childs.length() > 0) {
          buildColumnsHeader(sheet, childs, rowNum + 1, columnCounter, createHelper);
        }
        int increment = descendants > 1 ? descendants : 1;
        columnCounter = columnCounter + increment;
View Full Code Here

         
          operandValuesJSONArray = filterJSON.getJSONArray(QuerySerializationConstants.FILTER_RO_VALUE);
          operandValues = JSONUtils.asStringArray(operandValuesJSONArray);
          operandDescription = filterJSON.getString(QuerySerializationConstants.FILTER_RO_DESCRIPTION);
          operandType = filterJSON.getString(QuerySerializationConstants.FILTER_RO_TYPE);
          operandDefaultValuesJSONArray = filterJSON.optJSONArray(QuerySerializationConstants.FILTER_RO_DEFAULT_VALUE);
          operandLasDefaulttValues = JSONUtils.asStringArray(operandDefaultValuesJSONArray);
          operandLastValuesJSONArray = filterJSON.optJSONArray(QuerySerializationConstants.FILTER_RO_LAST_VALUE);
          operandLastValues = JSONUtils.asStringArray(operandLastValuesJSONArray);
          rightOperand = new WhereField.Operand(operandValues, operandDescription, operandType, operandLasDefaulttValues, operandLastValues);
         
View Full Code Here

          operandValues = JSONUtils.asStringArray(operandValuesJSONArray);
          operandDescription = filterJSON.getString(QuerySerializationConstants.FILTER_RO_DESCRIPTION);
          operandType = filterJSON.getString(QuerySerializationConstants.FILTER_RO_TYPE);
          operandDefaultValuesJSONArray = filterJSON.optJSONArray(QuerySerializationConstants.FILTER_RO_DEFAULT_VALUE);
          operandLasDefaulttValues = JSONUtils.asStringArray(operandDefaultValuesJSONArray);
          operandLastValuesJSONArray = filterJSON.optJSONArray(QuerySerializationConstants.FILTER_RO_LAST_VALUE);
          operandLastValues = JSONUtils.asStringArray(operandLastValuesJSONArray);
          rightOperand = new WhereField.Operand(operandValues, operandDescription, operandType, operandLasDefaulttValues, operandLastValues);
         
          booleanConnector = filterJSON.getString(QuerySerializationConstants.FILTER_BOOLEAN_CONNETOR);
         
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.