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

Examples of org.apache.sling.commons.json.io.JSONWriter


    @Override
    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));
            }
            writer.endArray();
        } catch (InvalidSyntaxException e) {
            throw new ServletException(e);
        } catch (JSONException e) {
            throw new ServletException(e);
        }
View Full Code Here

TOP

Related Classes of org.apache.sling.commons.json.io.JSONWriter

Copyright © 2018 www.massapicom. 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.