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
ConstructorsConstructorDescriptionDefault constructor.AnnotatedJsonMessageReader(com.emc.documentum.rest.config.BindingConfig bindingConfig) Constructor with a custom binding configuration. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T,R extends T>
R<T,R extends T>
Rread(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
-
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:
readin interfaceStreamingMessageReader- Type Parameters:
T- the model class typeR- the actual model instance type- Parameters:
clazz- the model class with annotationSerializableTypeinputStream- 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
-