Class EntityJsonReader<EntityType>
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader<EntityType>
org.nuxeo.ecm.core.io.marshallers.json.EntityJsonReader<EntityType>
- Type Parameters:
EntityType
- The managed Java type.
- All Implemented Interfaces:
Marshaller<EntityType>
,Reader<EntityType>
- Direct Known Subclasses:
AnnotationJsonReader
,BulkCommandJsonReader
,BulkStatusJsonReader
,CommentJsonReader
,DefaultListJsonReader
,DirectoryEntryJsonReader
,DocumentModelJsonReader
,NuxeoGroupJsonReader
,NuxeoOAuth2ServiceProviderReader
,NuxeoOAuth2TokenReader
,NuxeoPrincipalJsonReader
,OAuth2ClientReader
,SavedSearchRequestReader
,TaskCompletionRequestJsonReader
,WorkflowRequestJsonReader
Base class to read Nuxeo entity Json and convert it in Objects. This class checks the json is an object, the json
property "entity-type" is present and as expected and delegate the body reading to an abstract method.
- Since:
- 7.2
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader
ctx, registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal EntityType
read
(com.fasterxml.jackson.databind.JsonNode jn) Implement this method, read the entity data in the providedJsonNode
and return corresponding java object.protected abstract EntityType
readEntity
(com.fasterxml.jackson.databind.JsonNode jn) Implement this method to read the entity.Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader
accept, getBooleanField, getLongField, getNode, getStringField, getStringListField, read, readEntity
-
Constructor Details
-
EntityJsonReader
- Parameters:
entityType
- The expected "entity-type" property in the json.
-
-
Method Details
-
read
Description copied from class:AbstractJsonReader
Implement this method, read the entity data in the providedJsonNode
and return corresponding java object.- Specified by:
read
in classAbstractJsonReader<EntityType>
- Parameters:
jn
- A ready to useJsonNode
.- Returns:
- The unmarshalled entity.
- Throws:
IOException
-
readEntity
protected abstract EntityType readEntity(com.fasterxml.jackson.databind.JsonNode jn) throws IOException Implement this method to read the entity.- Parameters:
jn
- AJsonNode
pointing at the root of the json input.- Returns:
- The parsed entity.
- Throws:
IOException
- Since:
- 7.2
-