Package com.emc.documentum.rest.wire.json

# 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 Summary

  Constructors
  Constructor
  Description
  `AnnotatedJsonMessageReader()`
  Default constructor.
  `AnnotatedJsonMessageReader(com.emc.documentum.rest.config.BindingConfig bindingConfig)`
  Constructor with a custom binding configuration.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected <T, R extends T>
  R`
  `parse(com.fasterxml.jackson.core.JsonParser parser, Class<? extends T> clazz)`
  `<T, R extends T>
  R`
  `read(Class<? extends T> clazz, InputStream inputStream)`
  Read the message input stream and return it as a model instance.

  ### Methods inherited from class com.emc.documentum.rest.wire.RestBindingConfigAware

  `getBindingConfig`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`