Search in sources :

Example 1 with JsonSerializer

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

the class DocumentNodeState method asString.

private String asString(PropertyState prop) {
    if (prop == null) {
        return null;
    } else if (prop instanceof DocumentPropertyState) {
        return ((DocumentPropertyState) prop).getValue();
    }
    JsopBuilder builder = new JsopBuilder();
    new JsonSerializer(builder, store.getBlobSerializer()).serialize(prop);
    return builder.toString();
}
Also used : JsopBuilder(org.apache.jackrabbit.oak.commons.json.JsopBuilder) JsonSerializer(org.apache.jackrabbit.oak.json.JsonSerializer)

Example 2 with JsonSerializer

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

the class CommitDiff method setProperty.

private void setProperty(PropertyState property) {
    builder.resetWriter();
    JsonSerializer serializer = new JsonSerializer(builder, blobs);
    serializer.serialize(property);
    commit.updateProperty(bundlingHandler.getRootBundlePath(), bundlingHandler.getPropertyPath(property.getName()), serializer.toString());
    if ((property.getType() == Type.BINARY) || (property.getType() == Type.BINARIES)) {
        this.commit.markNodeHavingBinary(bundlingHandler.getRootBundlePath());
    }
}
Also used : JsonSerializer(org.apache.jackrabbit.oak.json.JsonSerializer)

Aggregations

JsonSerializer (org.apache.jackrabbit.oak.json.JsonSerializer)2 JsopBuilder (org.apache.jackrabbit.oak.commons.json.JsopBuilder)1