@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,
org.codehaus.jackson.JsonGenerator jg)
Implement this method to write the entity body.
|
extend, write
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField
public static final String ENTITY_TYPE
public DocumentTypeJsonWriter()
protected void writeEntityBody(DocumentType docType, org.codehaus.jackson.JsonGenerator jg) throws IOException
ExtensibleEntityJsonWriter
writeEntityBody
in class ExtensibleEntityJsonWriter<DocumentType>
docType
- The Java entity.jg
- A JsonGenerator
ready to write your entity as Json.IOException
Copyright © 2018 Nuxeo. All rights reserved.