@Setup(mode=SINGLETON, priority=2000) public class DirectoryEntryJsonWriter extends ExtensibleEntityJsonWriter<DirectoryEntry>
DirectoryEntry
to Json.
This marshaller is enrichable: register class implementing AbstractJsonEnricher
and managing
DirectoryEntry
.
This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter#extend(DirectoryEntry, JsonWriter)
.
Format is:
{
"entity-type": "directoryEntry",
"directoryName": "DIRECTORY_NAME", <- use it to update an existing document
"properties": {
<- entry properties depending on the directory schema (password fields are hidden)
<- format is managed by DocumentPropertiesJsonReader
}
<-- 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 |
---|
DirectoryEntryJsonWriter() |
Modifier and Type | Method and Description |
---|---|
static String |
getMessageString(String key,
Object[] params,
Locale locale) |
protected void |
writeEntityBody(DirectoryEntry entry,
com.fasterxml.jackson.core.JsonGenerator jg)
Implement this method to write the entity body.
|
protected boolean |
writeFetchedValue(com.fasterxml.jackson.core.JsonGenerator jg,
String directoryName,
String fieldName,
String value) |
protected boolean |
writeTranslatedValue(com.fasterxml.jackson.core.JsonGenerator jg,
String fieldName,
String value) |
extend, write
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
public static final String ENTITY_TYPE
public DirectoryEntryJsonWriter()
protected void writeEntityBody(DirectoryEntry entry, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
ExtensibleEntityJsonWriter
writeEntityBody
in class ExtensibleEntityJsonWriter<DirectoryEntry>
entry
- The Java entity.jg
- A JsonGenerator
ready to write your entity as Json.IOException
protected boolean writeFetchedValue(com.fasterxml.jackson.core.JsonGenerator jg, String directoryName, String fieldName, String value) throws IOException
IOException
protected boolean writeTranslatedValue(com.fasterxml.jackson.core.JsonGenerator jg, String fieldName, String value) throws IOException
IOException
public static String getMessageString(String key, Object[] params, Locale locale)
Copyright © 2018 Nuxeo. All rights reserved.