Class ExtensibleEntityJsonWriter<EntityType>
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<EntityType>
org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter<EntityType>
- Type Parameters:
- EntityType- The managed Java type.
- All Implemented Interfaces:
- Marshaller<EntityType>,- Writer<EntityType>
- Direct Known Subclasses:
- ACPJsonWriter,- AggregateJsonWriter,- AnnotationJsonWriter,- BinaryManagerStatusJsonWriter,- BulkCommandJsonWriter,- BulkStatusJsonWriter,- CapabilitiesJsonWriter,- CommentJsonWriter,- ConfigurationPropertiesJsonWriter,- ConnectStatusJsonWriter,- ConstraintJsonWriter,- DirectoryEntryJsonWriter,- DirectoryJsonWriter,- DocumentModelJsonWriter,- DocumentRouteWriter,- DocumentTypeJsonWriter,- DocumentValidationReportJsonWriter,- FacetJsonWriter,- GraphRouteWriter,- LogEntryJsonWriter,- MigrationJsonWriter,- NuxeoGroupJsonWriter,- NuxeoOAuth2ServiceProviderWriter,- NuxeoOAuth2TokenWriter,- NuxeoPrincipalJsonWriter,- OAuth2ClientWriter,- ProbeInfoJsonWriter,- ProbeStatusJsonWriter,- SavedSearchWriter,- ScheduleJsonWriter,- SchemaJsonWriter,- SequencerJsonWriter,- SimplifiedServerInfoJsonWriter,- TaskWriter
Base class to write Nuxeo Json entity. This class write the json object, the json "entity-type" property and enable
 all activated enrichers registered in the 
MarshallerRegistry and compatible with the marshalled Java type.- Since:
- 7.2
- 
Field SummaryFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriterctx, registry
- 
Constructor SummaryConstructorsConstructorDescriptionExtensibleEntityJsonWriter(String entityType, Class<EntityType> entityClass) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidextend(EntityType entity, com.fasterxml.jackson.core.JsonGenerator jg) Override this method to add additional property in the entity.voidwrite(EntityType entity, com.fasterxml.jackson.core.JsonGenerator jg) Implement this method to writes the entity in the providedJsonGenerator.protected abstract voidwriteEntityBody(EntityType entity, com.fasterxml.jackson.core.JsonGenerator jg) Implement this method to write the entity body.Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriteraccept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
- 
Constructor Details- 
ExtensibleEntityJsonWriter- Parameters:
- entityType- The "entity-type" Json property value.
- entityClass- The entity type.
 
 
- 
- 
Method Details- 
writepublic void write(EntityType entity, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException Description copied from class:AbstractJsonWriterImplement this method to writes the entity in the providedJsonGenerator.This method implementation can use injected properties. The JsonGenerator's flushing is done by this abstract class, it's also not not necessary to flush it. Do not close the providedJsonGenerator. It may be used is another marshaller calling this one.- Specified by:
- writein class- AbstractJsonWriter<EntityType>
- Parameters:
- entity- The entity to marshall as Json.
- jg- The- JsonGeneratorused to produce Json output.
- Throws:
- IOException
 
- 
writeEntityBodyprotected abstract void writeEntityBody(EntityType entity, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException Implement this method to write the entity body.- Parameters:
- entity- The Java entity.
- jg- A- JsonGeneratorready to write your entity as Json.
- Throws:
- IOException
- Since:
- 7.2
 
- 
extendprotected void extend(EntityType entity, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException Override this method to add additional property in the entity. This method is useful to override a marshaller implementing this class.- Parameters:
- entity- The Java entity.
- jg- A- JsonGeneratorready to write your entity as Json.
- Throws:
- IOException
- Since:
- 7.2
 
 
-