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) convertingObjects toPublishers ofDataChunks by using the suppliedObjectMapper.
-
-
-
Method Detail
-
reader
public static Reader<Object> reader(ObjectMapper objectMapper)
Returns aReaderthat converts aPublisherofByteBuffers to a Java object.This method is intended for the derivation of other, more specific readers.
- Parameters:
objectMapper- theObjectMapperto 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
RuntimeExceptionin case of I/O error - Throws:
NullPointerException- ifobjectMapperisnull
-
writer
public static Function<Object,Flow.Publisher<DataChunk>> writer(ObjectMapper objectMapper, Charset charset)
Returns a function (writer) convertingObjects toPublishers ofDataChunks by using the suppliedObjectMapper.- Parameters:
objectMapper- theObjectMapperto use; must not benullcharset- the charset to use; may be null- Returns:
- created function
- Throws:
NullPointerException- ifobjectMapperisnull
-
-