Package org.nuxeo.ecm.directory.io
Class DirectoryEntryJsonWriter
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<DirectoryEntry>
org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter<DirectoryEntry>
org.nuxeo.ecm.directory.io.DirectoryEntryJsonWriter
- All Implemented Interfaces:
Marshaller<DirectoryEntry>,Writer<DirectoryEntry>
@Setup(mode=SINGLETON,
priority=2000)
public class DirectoryEntryJsonWriter
extends ExtensibleEntityJsonWriter<DirectoryEntry>
Convert
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(Object, JsonGenerator).
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 {@link org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader}
}
<-- contextParameters if there are enrichers activated
<-- additional property provided by extend() method
}
- Since:
- 7.2
-
Field Summary
FieldsFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetMessageString(String key, Object[] params, Locale locale) protected voidwriteEntityBody(DirectoryEntry entry, com.fasterxml.jackson.core.JsonGenerator jg) Implement this method to write the entity body.protected booleanwriteFetchedValue(com.fasterxml.jackson.core.JsonGenerator jg, String directoryName, String fieldName, String value) protected booleanwriteTranslatedValue(com.fasterxml.jackson.core.JsonGenerator jg, String fieldName, String value) Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter
extend, writeMethods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
Field Details
-
ENTITY_TYPE
- See Also:
-
PARENT_FIELD_NAME
- Since:
- 11.1
- See Also:
-
-
Constructor Details
-
DirectoryEntryJsonWriter
public DirectoryEntryJsonWriter()
-
-
Method Details
-
writeEntityBody
protected void writeEntityBody(DirectoryEntry entry, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException Description copied from class:ExtensibleEntityJsonWriterImplement this method to write the entity body.- Specified by:
writeEntityBodyin classExtensibleEntityJsonWriter<DirectoryEntry>- Parameters:
entry- The Java entity.jg- AJsonGeneratorready to write your entity as Json.- Throws:
IOException
-
writeFetchedValue
protected boolean writeFetchedValue(com.fasterxml.jackson.core.JsonGenerator jg, String directoryName, String fieldName, String value) throws IOException - Throws:
IOException
-
writeTranslatedValue
protected boolean writeTranslatedValue(com.fasterxml.jackson.core.JsonGenerator jg, String fieldName, String value) throws IOException - Throws:
IOException
-
getMessageString
-