Class HasContentJsonEnricher
- 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.restapi.server.jaxrs.enrichers.HasContentJsonEnricher
-
- All Implemented Interfaces:
Marshaller<Enriched<DocumentModel>>,Writer<Enriched<DocumentModel>>
@Setup(mode=SINGLETON, priority=2000) public class HasContentJsonEnricher extends AbstractJsonEnricher<DocumentModel>
Enricher that tells whether a "Folderish" or a "Collection" has children or members.- Since:
- 10.3
-
-
Field Summary
Fields Modifier and Type Field Description static StringFETCH_CHILD_QUERYstatic StringFETCH_MEMBERS_QUERYstatic StringNAME-
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
Constructors Constructor Description HasContentJsonEnricher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanhasContent(DocumentModel document, String query)voidwrite(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel document)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, write
-
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
FETCH_CHILD_QUERY
public static final String FETCH_CHILD_QUERY
- See Also:
- Constant Field Values
-
FETCH_MEMBERS_QUERY
public static final String FETCH_MEMBERS_QUERY
- See Also:
- Constant Field Values
-
-
Method Detail
-
write
public void write(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel document) throws IOExceptionDescription 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.document- The enriched entity.- Throws:
IOException
-
hasContent
protected boolean hasContent(DocumentModel document, String query) throws IOException
- Throws:
IOException
-
-