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

public abstract class EntityJsonReader<EntityType> extends AbstractJsonReader<EntityType>
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
  • Constructor Details

    • EntityJsonReader

      public EntityJsonReader(String entityType)
      Parameters:
      entityType - The expected "entity-type" property in the json.
  • Method Details

    • read

      public final EntityType read(com.fasterxml.jackson.databind.JsonNode jn) throws IOException
      Description copied from class: AbstractJsonReader
      Implement this method, read the entity data in the provided JsonNode and return corresponding java object.
      Specified by:
      read in class AbstractJsonReader<EntityType>
      Parameters:
      jn - A ready to use JsonNode.
      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 - A JsonNode pointing at the root of the json input.
      Returns:
      The parsed entity.
      Throws:
      IOException
      Since:
      7.2