Examples of object()


Examples of org.apache.sling.commons.json.io.JSONWriter.object()

        final Writer out = response.getWriter();
        final JSONWriter w = new JSONWriter(out);

        try {
            w.object();
            for (Map.Entry<String, String> e : data.entrySet()) {
                w.key(e.getKey());
                w.value(e.getValue());
            }
            w.endObject();
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.object()

    /** Dump given property in JSON */
    public void dump(Property p, Writer w) throws JSONException,
            ValueFormatException, RepositoryException {
        final JSONWriter jw = new JSONWriter(w);
        jw.object();
        writeProperty(jw, p);
        jw.endObject();
    }

    /** Dump given node in JSON, optionally recursing into its child nodes */
 
View Full Code Here

Examples of org.apache.tapestry.json.IJSONWriter.object()

       
        component.renderComponent(writer, cycle);
       
        verify();
       
        JSONObject json = writer.object();
       
        assertEquals(json.length(), 3);
        assertEquals(json.get("1"), "Simple 1");
        assertEquals(json.get("2"), "Simple 2");
        assertEquals(json.get("3"), "Simple 3");
View Full Code Here

Examples of org.apache.wicket.ajax.json.JSONStringer.object()

  private Boolean dropdownAutoWidth;

  public CharSequence toJson() {
    try {
      JSONStringer writer = new JSONStringer();
      writer.object();
      Json.writeObject(writer, "minimumInputLength", minimumInputLength);
      Json.writeObject(writer, "minimumResultsForSearch", minimumResultsForSearch);
      Json.writeObject(writer, "maximumSelectionSize", maximumSelectionSize);
      Json.writeObject(writer, "placeholder", placeholder);
      Json.writeObject(writer, "allowClear", allowClear);
View Full Code Here

Examples of org.apache.wicket.ajax.json.JSONWriter.object()

    OutputStreamWriter out = new OutputStreamWriter(webResponse.getOutputStream(), getRequest().getCharset());
    JSONWriter json = new JSONWriter(out);

    try {
      json.object();
      json.key("results").array();
      for (T item : response) {
        json.object();
        provider.toJson(item, json);
        json.endObject();
View Full Code Here

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

     */
    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("{}"));
View Full Code Here

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

    public void test_WriteEmptyObject() {
        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("{}"));
View Full Code Here

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

        Exception ex = null;
        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("{}"));
View Full Code Here

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

        try{
            StringWriter w = new StringWriter();
            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
            JSONFactory factory = JSONFactory.newInstance();
            JSONWriter jWriter = factory.createJSONWriter(w);
            jWriter.object();
            jWriter.key("foo");
            jWriter.value(true);
            jWriter.close();
            String str = w.toString();
            // Verify it parses.
View Full Code Here

Examples of org.apache.xpath.objects.XNodeSetForDOM.object()

        dbf.setValidating(false);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document d = db.newDocument();
        Element root = d.createElement("root");
        XNodeSetForDOM xo = (XNodeSetForDOM) XObjectFactory.create(root, xpathContext);
        Assert.assertEquals(root, xo.object());

    }
}
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.