Search in sources :

Example 11 with JsopWriter

use of org.apache.jackrabbit.oak.commons.json.JsopWriter in project jackrabbit-oak by apache.

the class LuceneJournalPropertyBuilder method buildAsString.

@Override
public String buildAsString() {
    JsopWriter json = new JsopBuilder();
    json.object();
    for (Map.Entry<String, Collection<String>> e : indexedNodes.asMap().entrySet()) {
        json.key(e.getKey()).array();
        for (String v : e.getValue()) {
            json.value(v);
        }
        json.endArray();
    }
    json.endObject();
    return json.toString();
}
Also used : JsopBuilder(org.apache.jackrabbit.oak.commons.json.JsopBuilder) Collection(java.util.Collection) Map(java.util.Map) JsopWriter(org.apache.jackrabbit.oak.commons.json.JsopWriter)

Aggregations

JsopWriter (org.apache.jackrabbit.oak.commons.json.JsopWriter)11 JsopBuilder (org.apache.jackrabbit.oak.commons.json.JsopBuilder)9 NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)3 Test (org.junit.Test)3 Map (java.util.Map)2 JsopStream (org.apache.jackrabbit.oak.commons.json.JsopStream)2 AbstractDocumentNodeState (org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState)2 DocumentNodeState (org.apache.jackrabbit.oak.plugins.document.DocumentNodeState)2 DelegatingDocumentNodeState (org.apache.jackrabbit.oak.plugins.document.secondary.DelegatingDocumentNodeState)2 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 PropertyState (org.apache.jackrabbit.oak.api.PropertyState)1