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

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


                if (!properties.isEmpty()) {
                    Resource nodeRes = resolver.getResource(path);
                    dumpProperties(w, nodeRes, properties);
                }

                w.endObject();


                count--;
            }
            w.endArray();
View Full Code Here


            w.object();
            for (Map.Entry<String, String> e : data.entrySet()) {
                w.key(e.getKey());
                w.value(e.getValue());
            }
            w.endObject();

        } catch (JSONException jse) {
            out.write(jse.toString());

        } finally {
View Full Code Here

            writer.object();
            writer.key("status").value(status ? "OK" : "FAILURE");
            if (!StringUtils.isEmpty(message)) {
                writer.key("message").value(message);
            }
            writer.endObject();
        } catch (JSONException e) {
            // never happens
            throw new RuntimeException(e);
        }
    }
View Full Code Here

                w.object();
                w.key("info");
                w.value("Background job information");
                w.key("jobStreamPath");
                w.value(streamPath);
                w.endObject();
            } catch (JSONException e) {
                throw (IOException)new IOException("JSONException in " + getClass().getSimpleName()).initCause(e);
            }
        }
    }
View Full Code Here

            String mode = determineMode(sef.getExtensions());
            if(mode != null){
                jw.key("mode").value(mode);
            }

            jw.endObject();
        }

        jw.endArray();
        return sw.toString();
    }
View Full Code Here

            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 Object value = props.get(key);
                if(value != null) {
                    w.key(key.toString()).value(value.toString());
                }
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
    }
View Full Code Here

                if(value != null) {
                    w.key(key.toString()).value(value.toString());
                }
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
    }
}
View Full Code Here

            w.key("descriptors");
            w.object();
            for(String key : repository.getDescriptorKeys()) {
                w.key(key).value(repository.getDescriptor(key));
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
        response.getWriter().flush();
View Full Code Here

            w.object();
            for(String key : repository.getDescriptorKeys()) {
                w.key(key).value(repository.getDescriptor(key));
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
        response.getWriter().flush();
    }
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.