Class DocumentPropertyJsonWriter
- java.lang.Object
-
- org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<Property>
-
- org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter
-
- All Implemented Interfaces:
Marshaller<Property>
,Writer<Property>
@Setup(mode=SINGLETON, priority=2000) public class DocumentPropertyJsonWriter extends AbstractJsonWriter<Property>
ConvertProperty
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 }
- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description static String
OMIT_PHANTOM_SECURED_PROPERTY
Whether we should omit to write phantom secured properties.-
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
-
Constructor Summary
Constructors Constructor Description DocumentPropertyJsonWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
enrichBlobProperty(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty property)
protected boolean
fetchProperty(com.fasterxml.jackson.core.JsonGenerator jg, ObjectResolver resolver, Object value, String path)
protected String
getBlobUrl(Property prop)
Gets the full URL of where a blob can be downloaded.protected static boolean
skipProperty(RenderingContext ctx, Property property)
void
write(Property prop, com.fasterxml.jackson.core.JsonGenerator jg)
Implement this method to writes the entity in the providedJsonGenerator
.protected void
writeBlobProperty(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty prop)
protected void
writeComplexProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop)
protected void
writeListProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop)
protected void
writeProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop)
protected void
writeScalarProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop)
protected void
writeScalarPropertyValue(com.fasterxml.jackson.core.JsonGenerator jg, Type type, Object value)
-
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
-
-
-
Field Detail
-
OMIT_PHANTOM_SECURED_PROPERTY
public static final String OMIT_PHANTOM_SECURED_PROPERTY
Whether we should omit to write phantom secured properties.- Since:
- 11.1
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DocumentPropertyJsonWriter
public DocumentPropertyJsonWriter()
-
-
Method Detail
-
write
public void write(Property prop, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
Description copied from class:AbstractJsonWriter
Implement this method to writes the entity in the providedJsonGenerator
.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 providedJsonGenerator
. It may be used is another marshaller calling this one.- Specified by:
write
in classAbstractJsonWriter<Property>
- Parameters:
prop
- The entity to marshall as Json.jg
- TheJsonGenerator
used to produce Json output.- Throws:
IOException
-
writeProperty
protected void writeProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop) throws IOException
- Throws:
IOException
-
writeScalarProperty
protected void writeScalarProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop) throws IOException
- Throws:
IOException
-
writeScalarPropertyValue
protected void writeScalarPropertyValue(com.fasterxml.jackson.core.JsonGenerator jg, Type type, Object value) throws IOException
- Throws:
IOException
-
fetchProperty
protected boolean fetchProperty(com.fasterxml.jackson.core.JsonGenerator jg, ObjectResolver resolver, Object value, String path) throws IOException
- Throws:
IOException
-
writeListProperty
protected void writeListProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop) throws IOException
- Throws:
IOException
-
writeComplexProperty
protected void writeComplexProperty(com.fasterxml.jackson.core.JsonGenerator jg, Property prop) throws IOException
- Throws:
IOException
-
writeBlobProperty
protected void writeBlobProperty(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty prop) throws IOException
- Throws:
IOException
-
enrichBlobProperty
protected void enrichBlobProperty(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty property) throws IOException
- Throws:
IOException
- Since:
- 10.3
-
getBlobUrl
protected String getBlobUrl(Property prop)
Gets the full URL of where a blob can be downloaded.- Since:
- 7.2
-
skipProperty
protected static boolean skipProperty(RenderingContext ctx, Property property)
-
-