Package org.nuxeo.ecm.platform.types
Class SubtypesJsonEnricher
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.platform.types.SubtypesJsonEnricher
- All Implemented Interfaces:
Marshaller<Enriched<DocumentModel>>
,Writer<Enriched<DocumentModel>>
@Setup(mode=SINGLETON,
priority=2000)
public class SubtypesJsonEnricher
extends AbstractJsonEnricher<DocumentModel>
Enrich
DocumentModel
JSON object with an array of the document types that can be created under the current
document taking account the local configuration.- Since:
- 11.5
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
ENTITY_ENRICHER_NAME, MAPPER
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String>
computeLocalConfigurationSubtypes
(DocumentModel enriched, Collection<String> defaultSubtypes) protected Collection<String>
computeSubtypes
(DocumentModel enriched) void
write
(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel enriched) When implementing this method, the providedJsonGenerator
expect 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, write
Methods 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
-
SubtypesJsonEnricher
public SubtypesJsonEnricher()
-
-
Method Details
-
write
public void write(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel enriched) throws IOException Description copied from class:AbstractJsonEnricher
When implementing this method, the providedJsonGenerator
expect you write a field name and a field value (or many).- Specified by:
write
in classAbstractJsonEnricher<DocumentModel>
- Parameters:
jg
- TheJsonGenerator
to use.enriched
- The enriched entity.- Throws:
IOException
-
computeSubtypes
-
computeLocalConfigurationSubtypes
protected Collection<String> computeLocalConfigurationSubtypes(DocumentModel enriched, Collection<String> defaultSubtypes)
-