Package io.helidon.media.jsonp.common
Class JsonProcessing
- java.lang.Object
-
- io.helidon.media.jsonp.common.JsonProcessing
-
public final class JsonProcessing extends Object
Support for json processing integration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonProcessing.Builder
Fluent-API builder forJsonProcessing
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonProcessing.Builder
builder()
Fluent API builder to create instances of JSON-P.static JsonProcessing
create()
Provides a default instance for JSON-P readers and writers.static JsonProcessing
create(Map<String,?> jsonPConfig)
Create an instance with the provided JSON-P configuration.Reader<JsonStructure>
reader()
Returns a function (reader) convertingPublisher
ofByteBuffer
s to a JSON-P object.Reader<JsonStructure>
reader(Charset charset)
Returns a function (reader) convertingPublisher
ofByteBuffer
s to a JSON-P object.Function<JsonStructure,Flow.Publisher<DataChunk>>
writer()
Function<JsonStructure,Flow.Publisher<DataChunk>>
writer(Charset charset)
-
-
-
Method Detail
-
reader
public Reader<JsonStructure> reader()
Returns a function (reader) convertingPublisher
ofByteBuffer
s to a JSON-P object.It is intended for derivation of others, more specific readers.
- Returns:
- the byte array content reader that transforms a publisher of byte buffers to a completion stage that
might end exceptionally with a
IllegalArgumentException
in case of I/O error or aJsonException
-
reader
public Reader<JsonStructure> reader(Charset charset)
Returns a function (reader) convertingPublisher
ofByteBuffer
s to a JSON-P object.It is intended for derivation of others, more specific readers.
- Parameters:
charset
- a charset to use charset- Returns:
- the byte array content reader that transforms a publisher of byte buffers to a completion stage that
might end exceptionally with a
IllegalArgumentException
in case of I/O error or aJsonException
-
writer
public Function<JsonStructure,Flow.Publisher<DataChunk>> writer(Charset charset)
- Parameters:
charset
- a charset to use ornull
for default charset- Returns:
- created function
-
writer
public Function<JsonStructure,Flow.Publisher<DataChunk>> writer()
- Returns:
- created function
-
create
public static JsonProcessing create()
Provides a default instance for JSON-P readers and writers.- Returns:
- json processing with default configuration
-
create
public static JsonProcessing create(Map<String,?> jsonPConfig)
Create an instance with the provided JSON-P configuration.- Parameters:
jsonPConfig
- configuration of the processing library- Returns:
- a configured JSON-P instance
-
builder
public static JsonProcessing.Builder builder()
Fluent API builder to create instances of JSON-P.- Returns:
- a new builder instance
-
-