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

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


        response.setContentType("application/json");
        response.setCharacterEncoding("UTF-8");
        final JSONWriter w = new JSONWriter(response.getWriter());
        try {
            w.object();
            w.key("info").value("Requested state change");
            w.key(PARAM_STATE).value(desiredState.toString());
            w.key("path").value(j.getPath());
            w.key("currentState").value(newState);
            w.key("stateChanged").value(newState != oldState);
            w.endObject();
View Full Code Here


        response.setCharacterEncoding("UTF-8");
        final JSONWriter w = new JSONWriter(response.getWriter());
        try {
            w.object();
            w.key("info").value("Requested state change");
            w.key(PARAM_STATE).value(desiredState.toString());
            w.key("path").value(j.getPath());
            w.key("currentState").value(newState);
            w.key("stateChanged").value(newState != oldState);
            w.endObject();
        } catch(JSONException je) {
View Full Code Here

        final JSONWriter w = new JSONWriter(response.getWriter());
        try {
            w.object();
            w.key("info").value("Requested state change");
            w.key(PARAM_STATE).value(desiredState.toString());
            w.key("path").value(j.getPath());
            w.key("currentState").value(newState);
            w.key("stateChanged").value(newState != oldState);
            w.endObject();
        } catch(JSONException je) {
            throw new ServletException("JSONException in doPost", je);
View Full Code Here

        try {
            w.object();
            w.key("info").value("Requested state change");
            w.key(PARAM_STATE).value(desiredState.toString());
            w.key("path").value(j.getPath());
            w.key("currentState").value(newState);
            w.key("stateChanged").value(newState != oldState);
            w.endObject();
        } catch(JSONException je) {
            throw new ServletException("JSONException in doPost", je);
        }
View Full Code Here

            w.object();
            w.key("info").value("Requested state change");
            w.key(PARAM_STATE).value(desiredState.toString());
            w.key("path").value(j.getPath());
            w.key("currentState").value(newState);
            w.key("stateChanged").value(newState != oldState);
            w.endObject();
        } catch(JSONException je) {
            throw new ServletException("JSONException in doPost", je);
        }
    }
View Full Code Here

        final Enumeration<?> keys = props.keys();
        try {
            final JSONWriter w = new JSONWriter(response.getWriter());
            w.setTidy(Arrays.asList(request.getRequestPathInfo().getSelectors()).contains("tidy"));
            w.object();
            w.key("source").value(getClass().getName());
            w.key("pid").value(pid);
            w.key("properties");
            w.object();
            while(keys.hasMoreElements()) {
                final Object key = keys.nextElement();
View Full Code Here

        try {
            final JSONWriter w = new JSONWriter(response.getWriter());
            w.setTidy(Arrays.asList(request.getRequestPathInfo().getSelectors()).contains("tidy"));
            w.object();
            w.key("source").value(getClass().getName());
            w.key("pid").value(pid);
            w.key("properties");
            w.object();
            while(keys.hasMoreElements()) {
                final Object key = keys.nextElement();
                final Object value = props.get(key);
View Full Code Here

            final JSONWriter w = new JSONWriter(response.getWriter());
            w.setTidy(Arrays.asList(request.getRequestPathInfo().getSelectors()).contains("tidy"));
            w.object();
            w.key("source").value(getClass().getName());
            w.key("pid").value(pid);
            w.key("properties");
            w.object();
            while(keys.hasMoreElements()) {
                final Object key = keys.nextElement();
                final Object value = props.get(key);
                if(value != null) {
View Full Code Here

            w.object();
            while(keys.hasMoreElements()) {
                final Object key = keys.nextElement();
                final Object value = props.get(key);
                if(value != null) {
                    w.key(key.toString()).value(value.toString());
                }
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
View Full Code Here

        response.setCharacterEncoding("UTF-8");
        try {
            final JSONWriter w = new JSONWriter(response.getWriter());
            w.setTidy(Arrays.asList(request.getRequestPathInfo().getSelectors()).contains("tidy"));
            w.object();
            w.key("descriptors");
            w.object();
            for(String key : repository.getDescriptorKeys()) {
                w.key(key).value(repository.getDescriptor(key));
            }
            w.endObject();
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.