@Setup(mode=SINGLETON, priority=2001) public class DocumentTypeJsonWriter extends ExtensibleEntityJsonWriter<DocumentType>
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(DocumentType, JsonWriter).
Format is:
{
"entity-type":"docType",
"name": "DOC_TYPE_NAME",
"parent": null|"DOC_TYPE_PARENT"
"facets": [ "FACET1", "FACET2", ... ],
"schemas": [ { see {@link SchemaJsonWriter} for format }, { ... }, ... ],
<-- contextParameters if there are enrichers activated
<-- additional property provided by extend() method
}
| Modifier and Type | Field and Description |
|---|---|
static String |
ENTITY_TYPE |
ctx, registry| Constructor and Description |
|---|
DocumentTypeJsonWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
writeEntityBody(DocumentType docType,
com.fasterxml.jackson.core.JsonGenerator jg)
Implement this method to write the entity body.
|
extend, writeaccept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapFieldpublic static final String ENTITY_TYPE
public DocumentTypeJsonWriter()
protected void writeEntityBody(DocumentType docType, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
ExtensibleEntityJsonWriterwriteEntityBody in class ExtensibleEntityJsonWriter<DocumentType>docType - The Java entity.jg - A JsonGenerator ready to write your entity as Json.IOExceptionCopyright © 2019 Nuxeo. All rights reserved.