@Setup(mode=SINGLETON, priority=2000) public class LogEntryJsonWriter extends ExtensibleEntityJsonWriter<LogEntry>
LogEntry
to Json.
This marshaller is enrichable: register class implementing AbstractJsonEnricher
and managing LogEntry
.
This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter.extend(Object, JsonGenerator)
.
Format is:
{ "entity-type":"logEntry", "category": "LOG_ENTRY_CATEGORY", "principalName": "LOG_ENTRY_PRINCIPAL", "comment": "LOG_ENTRY_COMMENT", "docLifeCycle": "DOC_LIFECYCLE", "docPath": "DOC_PATH", "docType": "DOC_TYPE", "docUUID": "DOC_UUID", "eventId": "EVENT_ID", "repositoryId": "REPO_ID", "eventDate": "LOG_EVENT_DATE", "logDate": "LOG_DATE" <-- 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 |
---|
LogEntryJsonWriter() |
Modifier and Type | Method and Description |
---|---|
protected void |
writeEntityBody(LogEntry logEntry,
org.codehaus.jackson.JsonGenerator jg)
Implement this method to write the entity body.
|
protected void |
writeExtendedInfo(org.codehaus.jackson.JsonGenerator jg,
String key,
Serializable value) |
protected void |
writeExtendedInfos(org.codehaus.jackson.JsonGenerator jg,
LogEntry logEntry) |
extend, write
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField
public static final String ENTITY_TYPE
public LogEntryJsonWriter()
protected void writeEntityBody(LogEntry logEntry, org.codehaus.jackson.JsonGenerator jg) throws IOException
ExtensibleEntityJsonWriter
writeEntityBody
in class ExtensibleEntityJsonWriter<LogEntry>
logEntry
- The Java entity.jg
- A JsonGenerator
ready to write your entity as Json.IOException
protected void writeExtendedInfos(org.codehaus.jackson.JsonGenerator jg, LogEntry logEntry) throws IOException
IOException
protected void writeExtendedInfo(org.codehaus.jackson.JsonGenerator jg, String key, Serializable value) throws IOException
IOException
Copyright © 2018 Nuxeo. All rights reserved.