Package io.helidon.media.jackson.common
Class JacksonBodyReader
- java.lang.Object
-
- io.helidon.media.jackson.common.JacksonBodyReader
-
- All Implemented Interfaces:
MessageBodyOperator<MessageBodyReaderContext>,MessageBodyReader<Object>
public final class JacksonBodyReader extends Object implements MessageBodyReader<Object>
Message body reader supporting object binding with Jackson.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(GenericType<?> type, MessageBodyReaderContext context)Test if the operator can convert the given type.static JacksonBodyReadercreate(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Create a newJacksonBodyReaderinstance.<U> Single<U>read(Flow.Publisher<DataChunk> publisher, GenericType<U> type, MessageBodyReaderContext context)Convert a HTTP payload into a Single publisher of the given type.
-
-
-
Method Detail
-
accept
public boolean accept(GenericType<?> type, MessageBodyReaderContext context)
Description copied from interface:MessageBodyOperatorTest if the operator can convert the given type.- Specified by:
acceptin interfaceMessageBodyOperator<MessageBodyReaderContext>- Parameters:
type- the requested typecontext- the context providing the headers abstraction- Returns:
trueif the operator can convert the specified type in the given context,falseotherwise
-
read
public <U> Single<U> read(Flow.Publisher<DataChunk> publisher, GenericType<U> type, MessageBodyReaderContext context)
Description copied from interface:MessageBodyReaderConvert a HTTP payload into a Single publisher of the given type.- Specified by:
readin interfaceMessageBodyReader<Object>- Type Parameters:
U- actual requested type parameter- Parameters:
publisher- HTTP payloadtype- requested typecontext- the context providing the headers abstraction- Returns:
- Single publisher
-
create
public static JacksonBodyReader create(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Create a newJacksonBodyReaderinstance.- Parameters:
objectMapper- object mapper to use- Returns:
- JacksonBodyWriter
-
-