Examples of endArray()


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

        final JSONWriter w = new JSONWriter(out);
        w.array();
        while (it.hasNext()) {
            dumpSingleNode(it.nextNode(), w, 1, 0);
        }
        w.endArray();
    }

    /** Dump given node in JSON, optionally recursing into its child nodes */
    public void dump(Node node, Writer w, int maxRecursionLevels)
            throws RepositoryException, JSONException {
View Full Code Here

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

      for (T item : response) {
        json.object();
        provider.toJson(item, json);
        json.endObject();
      }
      json.endArray();
      json.key("more").value(response.getHasMore()).endObject();
    } catch (JSONException e) {
      throw new RuntimeException("Could not write Json response", e);
    }
View Full Code Here

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

    public void test_WriteEmptyArray() {
        Exception ex = null;
        try{
            JSONStringer jStringer = new JSONStringer();
            jStringer.array();
            jStringer.endArray();
            String str = jStringer.toString();
            // Verify it parses.
            JSONArray test = new JSONArray(str);
            assertTrue(str.equals("[]"));
        }catch(Exception ex1){
View Full Code Here

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

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

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

        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.array();
            jStringer.endArray();
            String str = jStringer.toString();
            // Verify it parses.
            JSONArray test = factory.createJSONArray(str);
            assertTrue(str.equals("[]"));
        }catch(Exception ex1){
View Full Code Here

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

            JSONWriter jWriter = factory.createJSONWriter(w);
            jWriter.object();
            jWriter.key("foo");
            jWriter.array();
            jWriter.value(true);
            jWriter.endArray();
            jWriter.endObject();
            jWriter.close();
            String str = w.toString();

            // Verify it parses.
View Full Code Here

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

                        json.property("message", fe.getDefaultMessage());
                    }
                    writer.endObject();
                }
            }
            writer.endArray();
            writer.endObject();
        }
        catch (ConverterException ce) {
            throw ce;
        }
View Full Code Here

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

    JSONStringer st = new JSONStringer();
    JSONWriter writer = st.array();
    for(Jsonable<?> i: items) {
      writer = writer.value(new JSONObject(i.toJson()));
    }
    writer = writer.endArray();
   
    return writer.toString();
  }

  public String getGoodsJson(String categoryKeyStr) {
View Full Code Here

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

           
            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.endArray()

              writer.addField("name", reviewer.getUserID());
              writer.addField("displayName", reviewer.getDisplayName());
              writer.addField("email", reviewer.getEmail());
              writer.endObject();
            }
            writer.endArray();
            writer.endObject();
          }
        } else {
          //NOTE: Could not find version created by given designer... this could happen if a review has been deleted, but not
          //removed from the given reviewer's xml file. This could be an opportunity to prune the reviewer's index file.
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.