Package io.helidon.media.jsonb.common
Class JsonBinding
- java.lang.Object
-
- io.helidon.media.jsonb.common.JsonBinding
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Reader<Object>
reader(Jsonb jsonb)
static Function<Object,Flow.Publisher<DataChunk>>
writer(Jsonb jsonb, Charset charset)
-
-
-
Method Detail
-
reader
public static Reader<Object> reader(Jsonb jsonb)
Returns a newReader
that converts aPublisher
ofByteBuffer
s to a Java object.This method is intended for the derivation of other, more specific readers.
- Parameters:
jsonb
- theJsonb
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(Jsonb jsonb, Charset charset)
Returns a function (writer) convertingObject
s toPublisher
s ofDataChunk
s by using the suppliedJsonb
.- Parameters:
jsonb
- theJsonb
to use; must not benull
charset
- the charset to use; may be null- Returns:
- created function
- Throws:
NullPointerException
- ifjsonb
isnull
-
-