Package org.apache.sling.commons.json.io

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


     * @throws JSONException
     */
    public void dump(NodeIterator it, Writer out) throws RepositoryException,
            JSONException {
        final JSONWriter w = new JSONWriter(out);
        w.array();
        while (it.hasNext()) {
            dump(it.nextNode(), w, 1, 1);
        }
        w.endArray();
    }
View Full Code Here


            resp.setContentType(JsonRendererServlet.responseContentType);
            resp.setCharacterEncoding("UTF-8");

            final JSONWriter w = new JSONWriter(resp.getWriter());
            w.array();

            long count = -1;
            if (req.getParameter(ROWS) != null) {
                count = Long.parseLong(req.getParameter(ROWS));
            }
View Full Code Here

    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("application/json");
        JSONWriter writer = new JSONWriter(response.getWriter());
        try {
            writer.array();
            ServiceReference[] refs = bundleContext.getServiceReferences(ComponentFactory.class.getName(),
                    "(component.factory=com.day.cq.search.eval.PredicateEvaluator/*)");
            for (ServiceReference ref : refs) {
                writer.value(ref.getProperty("component.factory").toString().substring(42));
            }
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.