@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, write
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField
public static final String ENTITY_TYPE
public DirectoryEntryJsonWriter()
protected void writeEntityBody(DirectoryEntry entry, org.codehaus.jackson.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(org.codehaus.jackson.JsonGenerator jg, String directoryName, String fieldName, String value) throws IOException
IOException
protected boolean writeTranslatedValue(org.codehaus.jackson.JsonGenerator jg, String fieldName, String value) throws IOException
IOException
public static String getMessageString(String key, Object[] params, Locale locale)
Copyright © 2016 Nuxeo SA. All rights reserved.