Package org.nuxeo.ecm.directory.io
Class DirectoryEntryJsonWriter
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<EntityType>
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 DocumentPropertiesJsonReader}
}
<-- contextParameters if there are enrichers activated
<-- additional property provided by extend() method
}
- Since:
- 7.2
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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) Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter
extend, write
Methods 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:ExtensibleEntityJsonWriter
Implement this method to write the entity body.- Specified by:
writeEntityBody
in classExtensibleEntityJsonWriter<DirectoryEntry>
- Parameters:
entry
- The Java entity.jg
- AJsonGenerator
ready 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
-