Package org.json

Examples of org.json.JSONObject.optBoolean()


    for (int i=0; i<array.length(); ++i)
    {
      JSONObject info = array.getJSONObject(i);
      SenseiSystemInfo.SenseiFacetInfo facetInfo =
        new SenseiSystemInfo.SenseiFacetInfo(info.getString(SenseiSearchServletParams.PARAM_SYSINFO_FACETS_NAME));
      facetInfo.setRunTime(info.optBoolean(SenseiSearchServletParams.PARAM_SYSINFO_FACETS_RUNTIME));
      facetInfo.setProps(convertJsonToStringMap(info.optJSONObject(SenseiSearchServletParams.PARAM_SYSINFO_FACETS_PROPS)));

      infos.add(facetInfo);
    }
View Full Code Here


    JSONObject jsonObj = json.getJSONObject(field);

    final String  from, to;
    final boolean include_lower, include_upper;
    final boolean noOptimize = jsonObj.optBoolean(NOOPTIMIZE_PARAM, false);
    final String type;
    final String dateFormat;
   
    String gt  = jsonObj.optString(GT_PARAM, null);
    String gte = jsonObj.optString(GTE_PARAM, null);
View Full Code Here

      include_lower = true;
    }
    else
    {
      from          = jsonObj.optString(FROM_PARAM, null);
      include_lower = jsonObj.optBoolean(INCLUDE_LOWER_PARAM, true);
    }

    if (lt != null && lt.length() != 0)
    {
      to = lt;
View Full Code Here

      include_upper = true;
    }
    else
    {
      to            = jsonObj.optString(TO_PARAM, null);
      include_upper = jsonObj.optBoolean(INCLUDE_UPPER_PARAM, true);
    }

    return new SenseiFilter()
    {
      @Override
View Full Code Here

        schema._uidField = tableElem.getString("uid");
        schema._deleteField = tableElem.optString("delete-field", "");
        schema._skipField = tableElem.optString("skip-field", "");
        schema._srcDataStore = tableElem.optString("src-data-store", "");
        schema._srcDataField = tableElem.optString("src-data-field", "src_data");
        schema._compressSrcData = tableElem.optBoolean("compress-src-data", true);

        JSONArray columns = tableElem.optJSONArray("columns");

        int count = 0;
        if (columns != null) {
View Full Code Here

                fdef.formatter = null;
                fdef.fromField = frm.length() > 0 ? frm : n;

                fdef.isMeta = true;

                fdef.isMulti = column.optBoolean("multi");
                fdef.isActivity = column.optBoolean("activity");
                fdef.name = n;
                String delimString = column.optString("delimiter");
                if (delimString != null && delimString.trim().length() > 0) {
                    fdef.delim = delimString;
View Full Code Here

                fdef.fromField = frm.length() > 0 ? frm : n;

                fdef.isMeta = true;

                fdef.isMulti = column.optBoolean("multi");
                fdef.isActivity = column.optBoolean("activity");
                fdef.name = n;
                String delimString = column.optString("delimiter");
                if (delimString != null && delimString.trim().length() > 0) {
                    fdef.delim = delimString;
                }
View Full Code Here

                fdef.name = n;
                String delimString = column.optString("delimiter");
                if (delimString != null && delimString.trim().length() > 0) {
                    fdef.delim = delimString;
                }
                fdef.hasWildCards = column.optBoolean("wildcard");

                if (fdef.hasWildCards) {
                    Assert.isTrue(fdef.fromField.equals(fdef.name), "Cannot have a different \"from\" field with wildcards");
                    fdef.wildCardPattern = Pattern.compile(fdef.name);
                }
View Full Code Here

            @Override
            public boolean isDeleted() {
                try {
                    String type = filtered.optString(SenseiSchema.EVENT_TYPE_FIELD, null);
                    if (type == null)
                        return filtered.optBoolean(_delField);
                    else
                        return SenseiSchema.EVENT_TYPE_DELETE.equalsIgnoreCase(type);
                } catch (Exception e) {
                    logger.error(e.getMessage(), e);
                    return false;
View Full Code Here

            @Override
            public boolean isSkip() {
                try {
                    String type = filtered.optString(SenseiSchema.EVENT_TYPE_FIELD, null);
                    if (type == null)
                        return filtered.optBoolean(_skipField);
                    else
                        return SenseiSchema.EVENT_TYPE_SKIP.equalsIgnoreCase(type);
                } catch (Exception e) {
                    logger.error(e.getMessage(), e);
                    return false;
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.