Package com.emc.documentum.rest.wire.xml
Class AnnotatedXmlMessageReader
java.lang.Object
com.emc.documentum.rest.wire.RestBindingConfigAware
com.emc.documentum.rest.wire.xml.AnnotatedXmlMessageReader
- All Implemented Interfaces:
StreamingMessageReader
public class AnnotatedXmlMessageReader
extends RestBindingConfigAware
implements StreamingMessageReader
An implementation of
StreamingMessageReader
which reads the XML message and parse it as the annotated model instance.-
Constructor Summary
ConstructorDescriptionDefault constructor.AnnotatedXmlMessageReader
(com.emc.documentum.rest.config.BindingConfig bindingConfig) Constructor with a custom binding configuration. -
Method Summary
Modifier and TypeMethodDescription<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
-
AnnotatedXmlMessageReader
public AnnotatedXmlMessageReader()Default constructor. -
AnnotatedXmlMessageReader
public AnnotatedXmlMessageReader(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 interfaceStreamingMessageReader
- Type Parameters:
T
- the model class typeR
- the actual model instance type- Parameters:
clazz
- the model class with annotationSerializableType
inputStream
- the message input stream- Returns:
- the model instance
- Throws:
IOException
- when there are errors in reading the message
-