@Setup(mode=SINGLETON, priority=2000) public class DocumentPropertyJsonWriter extends AbstractJsonWriter<Property>
Property
to Json.
Format is:
"stringPropertyValue" <-- for string property, each property may be fetched if a resolver is associated with that property and if a parameter fetch.document=propXPath is present, in this case, an object will be marshalled as value or true|false <- for boolean property or 123 <- for int property ... { <- for complex property "subProperty": ..., ... }, [ ... ] <- for list property }
ctx, registry
Constructor and Description |
---|
DocumentPropertyJsonWriter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
fetchProperty(org.codehaus.jackson.JsonGenerator jg,
ObjectResolver resolver,
Object value,
String path) |
void |
write(Property prop,
org.codehaus.jackson.JsonGenerator jg)
Implement this method to writes the entity in the provided
JsonGenerator . |
protected void |
writeBlobProperty(org.codehaus.jackson.JsonGenerator jg,
Property prop) |
protected void |
writeComplexProperty(org.codehaus.jackson.JsonGenerator jg,
Property prop) |
protected void |
writeListProperty(org.codehaus.jackson.JsonGenerator jg,
Property prop) |
protected void |
writeProperty(org.codehaus.jackson.JsonGenerator jg,
Property prop) |
protected void |
writeScalarProperty(org.codehaus.jackson.JsonGenerator jg,
Property prop) |
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField
public DocumentPropertyJsonWriter()
public void write(Property prop, org.codehaus.jackson.JsonGenerator jg) throws IOException
AbstractJsonWriter
JsonGenerator
.
This method implementation can use injected properties.
The JsonGenerator
's flushing is done by this abstract class, it's also not not necessary to flush it. Do
not close the provided JsonGenerator
. It may be used is another marshaller calling this one.
write
in class AbstractJsonWriter<Property>
prop
- The entity to marshall as Json.jg
- The JsonGenerator
used to produce Json output.IOException
protected void writeProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOException
protected void writeScalarProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOException
protected boolean fetchProperty(org.codehaus.jackson.JsonGenerator jg, ObjectResolver resolver, Object value, String path) throws IOException
IOException
protected void writeListProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOException
protected void writeComplexProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOException
protected void writeBlobProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOException
Copyright © 2016 Nuxeo SA. All rights reserved.