Class AnnotatedJsonMessageReader

java.lang.Object
com.emc.documentum.rest.wire.RestBindingConfigAware
com.emc.documentum.rest.wire.json.AnnotatedJsonMessageReader
All Implemented Interfaces:
StreamingMessageReader

public class AnnotatedJsonMessageReader extends RestBindingConfigAware implements StreamingMessageReader
An implementation of StreamingMessageReader which reads the JSON message and parse it as the annotated model instance.
  • Constructor Details

    • AnnotatedJsonMessageReader

      public AnnotatedJsonMessageReader()
      Default constructor.
    • AnnotatedJsonMessageReader

      public AnnotatedJsonMessageReader(com.emc.documentum.rest.config.BindingConfig bindingConfig)
      Constructor with a custom binding configuration.
      Parameters:
      bindingConfig - the binding configuration.
  • Method Details

    • read

      public <T, R extends T> R read(Class<? extends T> clazz, InputStream inputStream) throws IOException
      Read the message input stream and return it as a model instance.
      Specified by:
      read in interface StreamingMessageReader
      Type Parameters:
      T - the model class type
      R - the actual model instance type
      Parameters:
      clazz - the model class with annotation SerializableType
      inputStream - the message input stream
      Returns:
      the model instance
      Throws:
      IOException - when there are errors in reading the message
    • parse

      protected <T, R extends T> R parse(com.fasterxml.jackson.core.JsonParser parser, Class<? extends T> clazz) throws IOException
      Throws:
      IOException