@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(LogEntry, JsonWriter).
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, writeaccept, getGenerator, write, writeEntity, writeEntity, writeEntityFieldpublic static final String ENTITY_TYPE
public LogEntryJsonWriter()
protected void writeEntityBody(LogEntry logEntry, org.codehaus.jackson.JsonGenerator jg) throws IOException
ExtensibleEntityJsonWriterwriteEntityBody in class ExtensibleEntityJsonWriter<LogEntry>logEntry - The Java entity.jg - A JsonGenerator ready to write your entity as Json.IOExceptionprotected void writeExtendedInfos(org.codehaus.jackson.JsonGenerator jg, LogEntry logEntry) throws IOException
IOExceptionprotected void writeExtendedInfo(org.codehaus.jackson.JsonGenerator jg, String key, Serializable value) throws IOException
IOExceptionCopyright © 2016 Nuxeo SA. All rights reserved.