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>
ConvertDirectoryEntry
to Json.This marshaller is enrichable: register class implementing
AbstractJsonEnricher
and managingDirectoryEntry
.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 Modifier and Type Field Description static String
ENTITY_TYPE
static String
PARENT_FIELD_NAME
-
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
-
Constructor Summary
Constructors Constructor Description DirectoryEntryJsonWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
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 Detail
-
ENTITY_TYPE
public static final String ENTITY_TYPE
- See Also:
- Constant Field Values
-
PARENT_FIELD_NAME
public static final String PARENT_FIELD_NAME
- Since:
- 11.1
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
-