Examples of endObject()


Examples of org.apache.wink.json4j.JSONStringer.endObject()

    public void test_WriteEmptyObject() {
        Exception ex = null;
        try{
            JSONStringer jStringer = new JSONStringer();
            jStringer.object();
            jStringer.endObject();
            String str = jStringer.toString();
            // Verify it parses.
            JSONObject test = new JSONObject(str);
            assertTrue(str.equals("{}"));
        }catch(Exception ex1){
View Full Code Here

Examples of org.apache.wink.json4j.JSONWriter.endObject()

        Exception ex = null;
        try{
            StringWriter w = new StringWriter();
            JSONWriter jWriter = new JSONWriter(w);
            jWriter.object();
            jWriter.endObject();
            String str = w.toString();
            // Verify it parses.
            JSONObject test = new JSONObject(str);
            assertTrue(str.equals("{}"));
        }catch(Exception ex1){
View Full Code Here

Examples of org.apache.wink.json4j.compat.JSONStringer.endObject()

        try{
            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
            JSONFactory factory = JSONFactory.newInstance();
            JSONStringer jStringer = factory.createJSONStringer();
            jStringer.object();
            jStringer.endObject();
            String str = jStringer.toString();
            // Verify it parses.
            JSONObject test = factory.createJSONObject(str);
            assertTrue(str.equals("{}"));
        }catch(Exception ex1){
View Full Code Here

Examples of org.apache.wink.json4j.compat.JSONWriter.endObject()

            jWriter.object();
            jWriter.key("foo");
            jWriter.object();
            jWriter.key("foo");
            jWriter.value(true);
            jWriter.endObject();
            jWriter.endObject();
            jWriter.close();
            String str = w.toString();

            // Verify it parses.
View Full Code Here

Examples of org.codehaus.groovy.grails.web.json.JSONWriter.endObject()

                        json.property("message", applicationContext.getMessage(fe, locale));
                    }
                    else {
                        json.property("message", fe.getDefaultMessage());
                    }
                    writer.endObject();
                } else if (o instanceof ObjectError) {
                    ObjectError fe = (ObjectError) o;
                    writer.object();
                    json.property("object", fe.getObjectName());
                    Locale locale = LocaleContextHolder.getLocale();
View Full Code Here

Examples of org.codehaus.jettison.json.JSONStringer.endObject()

    json.object();
    json.key("tableName");
    json.value(TABLE_NAME);
    json.key("cfName");
    json.value(CF_NAME);
    json.endObject();
    assertEquals(json.toString(), sc.schemaConfAsJSON());
  }

  /** Don't allow requesting metrics before setting table/CF name */
  @Test
View Full Code Here

Examples of org.codehaus.jettison.json.JSONWriter.endObject()

      .key(Category.DESCRIPTION).value(getDescription().getValue())
      .key(Category.PARENT_KEY_STR).value(getParentKeyStr())
      .key(Category.IMAGE_BLOB_KEY).value(getImageBlobKey());
     
      value = addAdditionalPropertiesToJson(value);
      String string = value.endObject().toString();
     
      return string;
    } catch (JSONException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of org.davinci.server.util.JSONWriter.endObject()

           
            jsonWriter.addField("hasSource", lib.getSourcePath()!=null);
           
            if( installedLibs[i].getVirtualRoot()!=null)
              jsonWriter.addField("root", installedLibs[i].getVirtualRoot());
            jsonWriter.endObject();
        }
        jsonWriter.endArray().endObject();
        this.responseString = jsonWriter.getJSON();
        resp.setContentType("application/json;charset=UTF-8");
    }
View Full Code Here

Examples of org.davinci.server.util.JSONWriter.endObject()

      }
      if (emailResult != null) {
        writer.addField("emailResult", emailResult);
      }
    }
    writer.endObject();
    this.responseString = writer.getJSON();
        resp.setContentType("application/json;charset=UTF-8");
  }

  private String notifyRelatedPersons(String to, String subject, String htmlContent) {
View Full Code Here

Examples of org.davinci.server.util.JSONWriter.endObject()

            for(Reviewer reviewer:version.getReviewers()){
              writer.startObject();
              writer.addField("name", reviewer.getUserID());
              writer.addField("displayName", reviewer.getDisplayName());
              writer.addField("email", reviewer.getEmail());
              writer.endObject();
            }
            writer.endArray();
            writer.endObject();
          }
        } 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.