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

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


        final JSONWriter w = new JSONWriter(out);
        w.array();
        while (it.hasNext()) {
            dump(it.nextNode(), w, 1, 1);
        }
        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


                }

                w.endObject();
                count--;
            }
            w.endArray();
        } catch (JSONException je) {
            throw wrapException(je);
        }
    }
View Full Code Here

            w.object();
            w.key("tasks").array();
            for (RcpTask task: taskMgr.getTasks().values()) {
                task.write(w);
            }
            w.endArray();
            w.endObject();
        } catch (JSONException e) {
            throw new IOException(e.toString());
        }
View Full Code Here

            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));
            }
            writer.endArray();
        } catch (InvalidSyntaxException e) {
            throw new ServletException(e);
        } catch (JSONException e) {
            throw new ServletException(e);
        }
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.