Package org.apache.sling.commons.json

Examples of org.apache.sling.commons.json.JSONObject.accumulate()


                } else {
                    adaptableObj = new JSONObject();
                    obj.put(desc.adaptable, adaptableObj);
                }
                for (final String adapter : desc.adapters) {
                    adaptableObj.accumulate(desc.condition == null ? "" : desc.condition, adapter);
                }

            }
            resp.getWriter().println(obj.toString(INDENT));
        } catch (final JSONException e) {
View Full Code Here


            throws JSONResponseException {
        try {
            JSONObject change = new JSONObject();
            change.put(PROP_TYPE, type);
            for (String argument : arguments) {
                change.accumulate(PROP_ARGUMENT, argument);
            }
            changes.put(change);
        } catch (JSONException e) {
            throw new JSONResponseException(e);
        }
View Full Code Here

            if (currentBatch != null) {
                json.put(BulkWorkflowEngine.KEY_CURRENT_BATCH, currentBatch.getPath());

                for (final Resource child : currentBatch.getChildren()) {
                    json.accumulate("currentBatchItems", new JSONObject(child.adaptTo(ValueMap.class)));
                }

                final ValueMap currentBatchProperties = currentBatch.adaptTo(ValueMap.class);

                json.put(BulkWorkflowEngine.KEY_BATCH_TIMEOUT_COUNT, currentBatchProperties.get(BulkWorkflowEngine
View Full Code Here

        JSONObject parent = new JSONObject();
        parent.put("xtype", "dialogfieldset");
        parent.put("border", false);
        parent.put("padding", 0);
        parent.put("style", "padding: 0px");
        parent.accumulate("items", widget);
        parent.write(response.getWriter());
    }

}
View Full Code Here

        JSONObject parent = new JSONObject();
        parent.put("xtype", "dialogfieldset");
        parent.put("border", false);
        parent.put("padding", 0);
        parent.accumulate("items", widget);
        parent.write(response.getWriter());
    }

    @Activate
    protected void activate(Map<String, Object> props) {
View Full Code Here

                    if (t == EQ) {
                        t = x.nextToken();
                        if (!(t instanceof String)) {
                            throw x.syntaxError("Missing value");
                        }
                        o.accumulate(s, t);
                        t = null;
                    } else {
                        o.accumulate(s, "");
                    }
View Full Code Here

                            throw x.syntaxError("Missing value");
                        }
                        o.accumulate(s, t);
                        t = null;
                    } else {
                        o.accumulate(s, "");
                    }

// Empty tag <.../>

                } else if (t == SLASH) {
View Full Code Here

                            }
                            return false;
                        } else if (t instanceof String) {
                            s = (String)t;
                            if (s.length() > 0) {
                                o.accumulate("content", s);
                            }

// Nested element

                        } else if (t == LT) {
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.