Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONObject.opt()


            "text",constraint.optString("type"));

        assertEquals("The 'patternType' of the Constraint is not 'wildcard' but "+constraint.opt("patternType"),
            "wildcard",constraint.optString("patternType"));
       
        assertEquals("The 'field' of the Constraint is not "+getDefaultFindQueryField()+" but "+constraint.opt("field"),
            getDefaultFindQueryField(),constraint.optString("field"));
    }
    /**
     * Getter for the default field used for find queries of the 'field' parameter
     * is not defined.<p>
View Full Code Here


            obj = obj.getJSONObject("command");
            CachedCommandModel cm = new CachedCommandModel(obj.getString("@name"), etag);
            cm.dashOk = obj.optBoolean("@unknown-options-are-operands", false);
            cm.managedJob = obj.optBoolean("@managed-job", false);
            cm.setUsage(obj.optString("usage", null));
            Object optns = obj.opt("option");
            if (!JSONObject.NULL.equals(optns)) {
                JSONArray jsonOptions;
                if (optns instanceof JSONArray) {
                    jsonOptions = (JSONArray) optns;
                } else {
View Full Code Here

            obj = obj.getJSONObject("command");
            CachedCommandModel cm = new CachedCommandModel(obj.getString("@name"), etag);
            cm.dashOk = obj.optBoolean("@unknown-options-are-operands", false);
            cm.managedJob = obj.optBoolean("@managed-job", false);
            cm.setUsage(obj.optString("usage", null));
            Object optns = obj.opt("option");
            if (!JSONObject.NULL.equals(optns)) {
                JSONArray jsonOptions;
                if (optns instanceof JSONArray) {
                    jsonOptions = (JSONArray) optns;
                } else {
View Full Code Here

          continue;
        }
        // TODO: JRJC-122
        // we should use fieldParser here (some new version as the old one probably won't work)
        // enable IssueJsonParserTest#testParseIssueWithUserPickerCustomFieldFilledOut after fixing this
        final Object value = json.opt(key);
        res.add(new IssueField(key, namesMap.get(key), typesMap.get("key"), value != JSONObject.NULL ? value : null));
      } catch (final Exception e) {
        throw new JSONException("Error while parsing [" + key + "] field: " + e.getMessage()) {
          @Override
          public Throwable getCause() {
View Full Code Here

      final String key = iterator.next();
      try {
        if (SPECIAL_FIELDS.contains(key)) {
          continue;
        }
        final Object value = json.opt(key);
        res.add(new Field(key, namesMap.get(key), typesMap.get("key"), value != JSONObject.NULL ? value : null));
      } catch (final Exception e) {
        throw new JSONException("Error while parsing [" + key + "] field: " + e.getMessage()) {
          @Override
          public Throwable getCause() {
View Full Code Here

      final String key = iterator.next();
      try {
        if (SPECIAL_FIELDS.contains(key)) {
          continue;
        }
        final Object value = json.opt(key);
        res.add(new Field(key, namesMap.get(key), typesMap.get("key"), value != JSONObject.NULL ? value : null));
      } catch (final Exception e) {
        throw new JSONException("Error while parsing [" + key + "] field: " + e.getMessage()) {
          @Override
          public Throwable getCause() {
View Full Code Here

            obj = obj.getJSONObject("command");
            CachedCommandModel cm = new CachedCommandModel(obj.getString("@name"), etag);
            cm.dashOk = obj.optBoolean("@unknown-options-are-operands", false);
            cm.managedJob = obj.optBoolean("@managed-job", false);
            cm.setUsage(obj.optString("usage", null));
            Object optns = obj.opt("option");
            if (!JSONObject.NULL.equals(optns)) {
                JSONArray jsonOptions;
                if (optns instanceof JSONArray) {
                    jsonOptions = (JSONArray) optns;
                } else {
View Full Code Here

            obj = obj.getJSONObject("command");
            CachedCommandModel cm = new CachedCommandModel(obj.getString("@name"), etag);
            cm.dashOk = obj.optBoolean("@unknown-options-are-operands", false);
            cm.managedJob = obj.optBoolean("@managed-job", false);
            cm.setUsage(obj.optString("usage", null));
            Object optns = obj.opt("option");
            if (!JSONObject.NULL.equals(optns)) {
                JSONArray jsonOptions;
                if (optns instanceof JSONArray) {
                    jsonOptions = (JSONArray) optns;
                } else {
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.