@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, writeEntityFieldpublic DocumentPropertyJsonWriter()
public void write(Property prop, org.codehaus.jackson.JsonGenerator jg) throws IOException
AbstractJsonWriterJsonGenerator.
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.IOExceptionprotected void writeProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOExceptionprotected void writeScalarProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOExceptionprotected boolean fetchProperty(org.codehaus.jackson.JsonGenerator jg, ObjectResolver resolver, Object value, String path) throws IOException
IOExceptionprotected void writeListProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOExceptionprotected void writeComplexProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOExceptionprotected void writeBlobProperty(org.codehaus.jackson.JsonGenerator jg, Property prop) throws IOException
IOExceptionCopyright © 2016 Nuxeo SA. All rights reserved.