Class ObjectMapperPayloadReader
java.lang.Object
dev.getelements.elements.rt.jackson.ObjectMapperPayloadReader
- All Implemented Interfaces:
PayloadReader
Uses an instance of
ObjectMapper
to deserialize the payload from the InputStream
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
Reads the object to another type.com.fasterxml.jackson.databind.ObjectMapper
<T> T
read
(Class<T> payloadType, InputStream stream) Reads the actual response object to theInputStream
.void
setObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.rt.PayloadReader
read
-
Constructor Details
-
ObjectMapperPayloadReader
public ObjectMapperPayloadReader()
-
-
Method Details
-
convert
Description copied from interface:PayloadReader
Reads the object to another type.- Specified by:
convert
in interfacePayloadReader
- Type Parameters:
T
- the type- Parameters:
to
- the type to readfrom
- the type from which to read- Returns:
- an instance of the requested type, read from the supplied object.
-
read
Description copied from interface:PayloadReader
Reads the actual response object to theInputStream
.- Specified by:
read
in interfacePayloadReader
- Parameters:
payloadType
- the the response objectstream
- the output stream- Throws:
IOException
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
setObjectMapper
@Inject public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-