Examples of optString()


Examples of com.addthis.maljson.JSONObject.optString()

                info = jsonObj.getLineNumberInfo();
            }

            CodableClassInfo classInfo = getClassFieldMap(type);
            String classField = classInfo.getClassField();
            String stype = jsonObj.optString(classField, null);
            Class<?> atype;
            try {
                atype = stype != null ? classInfo.getClass(stype) : type;
            } catch (Exception ex) {
                throw new CodecExceptionLineNumber(ex, jsonObj.getValLineNumber(classField));
View Full Code Here

Examples of com.amazonaws.util.json.JSONObject.optString()

        }

        JSONObject jPrincipals = jStatement.getJSONObject(JsonDocumentFields.PRINCIPAL);
        String[] fields = JSONObject.getNames(jPrincipals);
        for (String field : fields) {
            String serviceId = jPrincipals.optString(field);
            if (serviceId != null && serviceId.length() > 0) {
                if (field.equalsIgnoreCase("AWS")) {
                statement.getPrincipals().add(new Principal(serviceId));
                } else if (field.equalsIgnoreCase("Service")) {
                    statement.getPrincipals().add(new Principal(Services.fromString(serviceId)));
View Full Code Here

Examples of com.dotcms.repackage.org.json.JSONObject.optString()

            throws ServletException, IOException {
        setResponeHeaders(response);
        try {
            JSONObject jsonInput = readRequest(request);

            String methodName = jsonInput.optString("method");
            if (methodName == null || methodName.trim().equals("")) {
                throw new SpellCheckException("Wrong spellchecker-method-name:" + methodName);
            }

View Full Code Here

Examples of com.google.appengine.repackaged.org.json.JSONObject.optString()

    @Override
    public String readProperty(String name){
        if(array == null) return null;
        JSONObject o = array.optJSONObject(index);
        if(o == null) return null;
        return o.optString(name, null);
    }

    /**
     * Create the new JSONRootReader on the current index.
     *
 
View Full Code Here

Examples of net.sf.json.JSONObject.optString()

        keepDependencies = req.getParameter("keepDependencies") != null;

        try {
            JSONObject json = req.getSubmittedForm();

            setDisplayName(json.optString("displayNameOrNull"));

            if (req.getParameter("logrotate") != null)
                logRotator = LogRotator.DESCRIPTOR.newInstance(req,json.getJSONObject("logrotate"));
            else
                logRotator = null;
View Full Code Here

Examples of org.amplafi.json.JSONObject.optString()

    @SuppressWarnings("unchecked")
    @Override
    public <T> T fromJson(Object object) {
        JSONObject json = JSONObject.toJsonObject(object);
        this.key = json.optString(KEY);
        this.label = json.optString(LABEL);
        this.nextFlow = json.optString(NEXT_FLOW);
        this.nextFlowType = json.optString(NEXT_FLOW_TYPE);
        this.transitionType = json.opt(TRANSITION_TYPE);
        this.transitionCompletionMessage = json.optString(TRANSITION_COMPLETION_MESSAGE);
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optString()

        // assert content at new location
        String content = getContent(importedNodeUrl2 + ".3.json", CONTENT_TYPE_JSON);

    JSONObject jsonObj = new JSONObject(content);
    assertNotNull(jsonObj);
    assertNull(jsonObj.optString("propTest", null)); //test property should be gone.

    //assert the imported content is there.
        String expectedJsonContent = getStreamAsString(getClass().getResourceAsStream("/integration-test/servlets/post/importresults.json"));
    assertExpectedJSON(new JSONObject(expectedJsonContent), jsonObj);
    }
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optString()

    assertEquals(1, jsonObject.length());
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);

          int order = aceObject.optInt("order");
          assertEquals(0, order);
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optString()

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optString()

    assertNull(deniedArray);

    JSONObject aceObject2 = jsonObject.optJSONObject(testUserId2);
    assertNotNull(aceObject2);

    String principalString2 = aceObject2.optString("principal");
    assertEquals(testUserId2, principalString2);
   
    JSONArray grantedArray2 = aceObject2.optJSONArray("granted");
    assertNotNull(grantedArray2);
    assertEquals(2, grantedArray2.length());
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.