Class DocumentTypeJsonWriter
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<EntityType>
org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter<DocumentType>
org.nuxeo.ecm.core.io.marshallers.json.types.DocumentTypeJsonWriter
- All Implemented Interfaces:
Marshaller<DocumentType>,Writer<DocumentType>
@Setup(mode=SINGLETON,
priority=2001)
public class DocumentTypeJsonWriter
extends ExtensibleEntityJsonWriter<DocumentType>
Convert
DocumentType to Json.
This marshaller is enrichable: register class implementing AbstractJsonEnricher and managing
DocumentType.
This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter.extend(Object, JsonGenerator).
Format is:
{
"entity-type":"docType",
"name": "DOC_TYPE_NAME",
"parent": null|"DOC_TYPE_PARENT"
"facets": [ "FACET1", "FACET2", ... ],
"schemas": [ { see SchemaJsonWriter for format }, { ... }, ... ],
<-- contextParameters if there are enrichers activated
<-- additional property provided by extend() method
}
- Since:
- 7.2
-
Field Summary
FieldsFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidwriteEntityBody(DocumentType docType, com.fasterxml.jackson.core.JsonGenerator jg) Implement this method to write the entity body.Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter
extend, writeMethods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
accept, getGenerator, write, writeEntity, writeEntity, writeEntityArrayField, writeEntityArrayField, writeEntityField, writeNumberFieldIfNotNull, writeObjectFieldIfNotEmpty, writeObjectFieldIfNotNull, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField, writeStringFieldIfNotNull, writeTemporalField
-
Field Details
-
ENTITY_TYPE
- See Also:
-
-
Constructor Details
-
DocumentTypeJsonWriter
public DocumentTypeJsonWriter()
-
-
Method Details
-
writeEntityBody
protected void writeEntityBody(DocumentType docType, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException Description copied from class:ExtensibleEntityJsonWriterImplement this method to write the entity body.- Specified by:
writeEntityBodyin classExtensibleEntityJsonWriter<DocumentType>- Parameters:
docType- The Java entity.jg- AJsonGeneratorready to write your entity as Json.- Throws:
IOException
-