Class ContextualParametersJsonEnricher
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<Enriched<EntityType>>
org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher<DocumentModel>
org.nuxeo.ecm.core.io.marshallers.json.enrichers.ContextualParametersJsonEnricher
- All Implemented Interfaces:
Marshaller<Enriched<DocumentModel>>,Writer<Enriched<DocumentModel>>
@Setup(mode=SINGLETON,
priority=2000)
public class ContextualParametersJsonEnricher
extends AbstractJsonEnricher<DocumentModel>
Enrich
DocumentModel Json.
Add custom key/value information as json attachment.
Enable if parameter enrichers-document=contextualParameters.
Format is:
{
"entity-type":"document",
...
"contextParameters": {
"KEY": "VALUE" <- key/value pairs come from context parameter "contextualParameters" - a Map<String, String> is expected.
}
}
- Since:
- 7.2
-
Field Summary
FieldsFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
ENTITY_ENRICHER_NAME, MAPPERFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel enriched) When implementing this method, the providedJsonGeneratorexpect you write a field name and a field value (or many).Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
accept, safeReadBuffer, writeMethods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
ContextualParametersJsonEnricher
public ContextualParametersJsonEnricher()
-
-
Method Details
-
write
public void write(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel enriched) throws IOException Description copied from class:AbstractJsonEnricherWhen implementing this method, the providedJsonGeneratorexpect you write a field name and a field value (or many).- Specified by:
writein classAbstractJsonEnricher<DocumentModel>- Parameters:
jg- TheJsonGeneratorto use.enriched- The enriched entity.- Throws:
IOException
-