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> TReads the object to another type.com.fasterxml.jackson.databind.ObjectMapper<T> Tread(Class<T> payloadType, InputStream stream) Reads the actual response object to theInputStream.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.rt.PayloadReader
read
-
Constructor Details
-
ObjectMapperPayloadReader
public ObjectMapperPayloadReader()
-
-
Method Details
-
convert
Description copied from interface:PayloadReaderReads the object to another type.- Specified by:
convertin 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:PayloadReaderReads the actual response object to theInputStream.- Specified by:
readin 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)
-