@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,
org.codehaus.jackson.JsonGenerator jg)
Implement this method to write the entity body.
|
protected boolean |
writeFetchedValue(org.codehaus.jackson.JsonGenerator jg,
String directoryName,
String fieldName,
String value) |
protected boolean |
writeTranslatedValue(org.codehaus.jackson.JsonGenerator jg,
String fieldName,
String value) |
extend, writeaccept, getGenerator, write, writeEntity, writeEntity, writeEntityFieldpublic static final String ENTITY_TYPE
public DirectoryEntryJsonWriter()
protected void writeEntityBody(DirectoryEntry entry, org.codehaus.jackson.JsonGenerator jg) throws IOException
ExtensibleEntityJsonWriterwriteEntityBody in class ExtensibleEntityJsonWriter<DirectoryEntry>entry - The Java entity.jg - A JsonGenerator ready to write your entity as Json.IOExceptionprotected boolean writeFetchedValue(org.codehaus.jackson.JsonGenerator jg, String directoryName, String fieldName, String value) throws IOException
IOExceptionprotected boolean writeTranslatedValue(org.codehaus.jackson.JsonGenerator jg, String fieldName, String value) throws IOException
IOExceptionpublic static String getMessageString(String key, Object[] params, Locale locale)
Copyright © 2018 Nuxeo. All rights reserved.