Package io.helidon.media.jackson.common
Class JacksonProcessing
- java.lang.Object
-
- io.helidon.media.jackson.common.JacksonProcessing
-
public final class JacksonProcessing extends Object
Utility methods for Jackson integration.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Reader<Object>
reader(ObjectMapper objectMapper)
static Function<Object,Flow.Publisher<DataChunk>>
writer(ObjectMapper objectMapper, Charset charset)
Returns a function (writer) convertingObject
s toPublisher
s ofDataChunk
s by using the suppliedObjectMapper
.
-
-
-
Method Detail
-
reader
public static Reader<Object> reader(ObjectMapper objectMapper)
Returns aReader
that converts aPublisher
ofByteBuffer
s to a Java object.This method is intended for the derivation of other, more specific readers.
- Parameters:
objectMapper
- theObjectMapper
to use; must not benull
- Returns:
- the byte array content reader that transforms a publisher of byte buffers to a completion stage that
might end exceptionally with a
RuntimeException
in case of I/O error - Throws:
NullPointerException
- ifobjectMapper
isnull
-
writer
public static Function<Object,Flow.Publisher<DataChunk>> writer(ObjectMapper objectMapper, Charset charset)
Returns a function (writer) convertingObject
s toPublisher
s ofDataChunk
s by using the suppliedObjectMapper
.- Parameters:
objectMapper
- theObjectMapper
to use; must not benull
charset
- the charset to use; may be null- Returns:
- created function
- Throws:
NullPointerException
- ifobjectMapper
isnull
-
-