Package org.codehaus.jettison.json

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


            if (rexsterRequestObject.has(Tokens.OFFSET)) {

                // returns zero if the value identified by the offsetToken is
                // not a number and the key is just present.
                if (rexsterRequestObject.optJSONObject(Tokens.OFFSET).has(offsetToken)) {
                    return rexsterRequestObject.optJSONObject(Tokens.OFFSET).optLong(offsetToken);
                } else {
                    return null;
                }
            } else {
                return null;
View Full Code Here


        }
        for (int i = 0; i < json.length(); i++) {
            JSONObject subJson = json.getJSONObject(i);
            MessagePart child = mp.addChild();
            child.setMessage(subJson.optString("message"));
            Properties props = (Properties) extractMap(subJson.optJSONObject("properties"), new Properties());
            for (Map.Entry entry : props.entrySet()) {
                child.addProperty(String.valueOf(entry.getKey()), String.valueOf(entry.getValue()));
            }
            fillSubMessages(child, subJson.optJSONArray("children"));
        }
View Full Code Here

    final ImmutableList.Builder<ErrorCollection> results = ImmutableList.builder();
    if (issues != null && issues.length() == 0) {
      final JSONArray errors = jsonObject.optJSONArray("errors");
      for (int i = 0; i < errors.length(); i++) {
        final JSONObject currentJsonObject = errors.getJSONObject(i);
        results.add(getErrorsFromJson(currentJsonObject.getInt("status"), currentJsonObject
            .optJSONObject("elementErrors")));
      }
    } else {
      results.add(getErrorsFromJson(status, jsonObject));
    }
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.