Package org.json

Examples of org.json.JSONObject.optBoolean()


    String text;
    boolean noOptimize = false;

    if (NOOPTIMIZE_PARAM.equals(field))
    {
      noOptimize = json.optBoolean(NOOPTIMIZE_PARAM, false);
      field = iter.next();
    }

    Object obj = json.get(field);
    if (obj instanceof JSONObject)
View Full Code Here


    Object obj = json.get(field);
    if (obj instanceof JSONObject)
    {
      text = ((JSONObject)obj).getString(VALUE_PARAM);
      noOptimize = json.optBoolean(NOOPTIMIZE_PARAM, false);
    }
    else
    {
      text = String.valueOf(obj);
    }
View Full Code Here

    else if (obj instanceof JSONObject){
      JSONObject jsonObj = (JSONObject)obj;
      String[] vals = RequestConverter2.getStrings(jsonObj, VALUES_PARAM);
      String[] notVals = RequestConverter2.getStrings(jsonObj, EXCLUDES_PARAM);
      String op = jsonObj.optString(OPERATOR_PARAM, OR_PARAM);
      noOptimize = jsonObj.optBoolean(NOOPTIMIZE_PARAM, false);
      boolean isAnd = false;
      if (!OR_PARAM.equals(op)){
        isAnd = true;
      }
      return new SenseiTermFilter(field, vals, notVals, isAnd, noOptimize);
View Full Code Here

          JSONObject facetObj = facets.getJSONObject(field);
          if (facetObj!=null){
           FacetSpec facetSpec = new FacetSpec();
           facetSpec.setMaxCount(facetObj.optInt(RequestConverter2.FACETS_MAX, 10));
           facetSpec.setMinHitCount(facetObj.optInt(RequestConverter2.FACETS_MINCOUNT, 1));
           facetSpec.setExpandSelection(facetObj.optBoolean(RequestConverter2.FACETS_EXPAND, false));

           String orderBy = facetObj.optString(RequestConverter2.FACETS_ORDER, RequestConverter2.FACETS_ORDER_HITS);
           FacetSpec.FacetSortSpec facetOrder = FacetSpec.FacetSortSpec.OrderHitsDesc;
           if (RequestConverter2.FACETS_ORDER_VAL.equals(orderBy)){
             facetOrder = FacetSpec.FacetSortSpec.OrderValueAsc;
View Full Code Here

        String facet = iter.next();
        JSONObject jsonParams = jsonSel.optJSONObject(facet);

        String upper = jsonParams.optString(RequestConverter2.SELECTIONS_RANGE_TO, "*");
        String lower = jsonParams.optString(RequestConverter2.SELECTIONS_RANGE_FROM, "*");
        boolean includeUpper = jsonParams.optBoolean(RequestConverter2.SELECTIONS_RANGE_INCLUDE_UPPER, true);
        boolean includeLower = jsonParams.optBoolean(RequestConverter2.SELECTIONS_RANGE_INCLUDE_LOWER, true);
        String left = "[", right = "]";
        if(includeLower == false)
          left = "(";
        if(includeUpper == false)
View Full Code Here

        JSONObject jsonParams = jsonSel.optJSONObject(facet);

        String upper = jsonParams.optString(RequestConverter2.SELECTIONS_RANGE_TO, "*");
        String lower = jsonParams.optString(RequestConverter2.SELECTIONS_RANGE_FROM, "*");
        boolean includeUpper = jsonParams.optBoolean(RequestConverter2.SELECTIONS_RANGE_INCLUDE_UPPER, true);
        boolean includeLower = jsonParams.optBoolean(RequestConverter2.SELECTIONS_RANGE_INCLUDE_LOWER, true);
        String left = "[", right = "]";
        if(includeLower == false)
          left = "(";
        if(includeUpper == false)
          right = ")";
View Full Code Here

          String[] vals = new String[1];
          vals[0] = value;
          sel.setValues(vals);

          if(jsonParams.has(RequestConverter2.SELECTIONS_PATH_STRICT)){
            boolean strict = jsonParams.optBoolean(RequestConverter2.SELECTIONS_PATH_STRICT, false);
            sel.getSelectionProperties().setProperty(PathFacetHandler.SEL_PROP_NAME_STRICT, String.valueOf(strict));
          }

          if(jsonParams.has(RequestConverter2.SELECTIONS_PATH_DEPTH)){
            int depth = jsonParams.optInt(RequestConverter2.SELECTIONS_PATH_DEPTH, 1);
View Full Code Here

                contentClassesPrefix = jsonDatabase.optString("content_classes_prefix", "");
                dbAuthorityPackage = jsonDatabase.optString("authority_package", classPackage);
                providerFolder = jsonDatabase.optString("provider_folder",
                        PathUtils.PROVIDER_DEFAULT);
                dbVersion = jsonDatabase.getInt("version");
                hasProviderSubclasses = jsonDatabase.optBoolean("has_subclasses");

                ArrayList<TableData> classDataList = TableData.getClassesData(root.getJSONArray(
                        "tables"), contentClassesPrefix, dbVersion);

                // Database generation
View Full Code Here

          String filterName = replicationJson.optString("filterName", null);
          if( null != filterName ) {
            replicationRequest.setFilter( filterName );
          }
         
          boolean continuous = replicationJson.optBoolean("continuous",false);
          if( continuous ) {
            replicationRequest.setContinuous(true);
          }
         
          config.addReplication(replicationRequest);
View Full Code Here

          String filterName = replicationJson.optString("filterName", null);
          if( null != filterName ) {
            replicationRequest.setFilter( filterName );
          }
         
          boolean continuous = replicationJson.optBoolean("continuous",false);
          if( continuous ) {
            replicationRequest.setContinuous(true);
          }
         
          config.addReplication(replicationRequest);
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.