java.lang.Object
io.helidon.media.jsonp.JsonpSupport
- All Implemented Interfaces:
MediaSupport
Support for JSON Processing integration.
For usage examples navigate to
MediaSupport
.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JsonpSupport.Builder
builder()
Fluent API builder to create instances of JSON-P.static JsonpSupport
create()
Provides a default instance for JSON-P readers and writers.static JsonpSupport
Create an instance with the provided JSON-P configuration.static MessageBodyStreamWriter<JsonStructure>
Return a default JSON-P entity event stream writer.static MessageBodyStreamWriter<JsonStructure>
eventStreamWriter
(JsonWriterFactory writerFactory) Create a new JSON-P entity stream writer based onJsonWriterFactory
instance.Return JSON-P stream writer.static MessageBodyStreamWriter<JsonStructure>
Return a default JSON-P entity event stream writer.static MessageBodyStreamWriter<JsonStructure>
ndJsonStreamWriter
(JsonWriterFactory writerFactory) Create a new JSON-P entity stream writer based onJsonWriterFactory
instance.Return JSON-P stream writer.static MessageBodyReader<JsonStructure>
reader()
Return a default JSON-P entity reader.static MessageBodyReader<JsonStructure>
reader
(JsonReaderFactory readerFactory) Create a new JSON-P entity reader based onJsonReaderFactory
.Return JSON-P reader instance.readers()
Returns the collection of the readers which should be registered.static MessageBodyStreamWriter<JsonStructure>
Return a default JSON-P entity stream writer.static MessageBodyStreamWriter<JsonStructure>
streamWriter
(JsonWriterFactory writerFactory) Create a new JSON-P entity stream writer based onJsonWriterFactory
.Return JSON-P stream writer.Returns the collection of the stream writers which should be registered.static MessageBodyWriter<JsonStructure>
writer()
Return a default JSON-P entity writer.static MessageBodyWriter<JsonStructure>
writer
(JsonWriterFactory writerFactory) Create a new JSON-P entity writer based onJsonWriterFactory
.Return JSON-P entity writer.writers()
Returns the collection of the writers which should be registered.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.media.common.MediaSupport
register, streamReaders
-
Method Details
-
create
Provides a default instance for JSON-P readers and writers.- Returns:
- json processing with default configuration
-
create
Create an instance with the provided JSON-P configuration.- Parameters:
jsonPConfig
- configuration of the processing library- Returns:
- a configured JSON-P instance
-
builder
Fluent API builder to create instances of JSON-P.- Returns:
- a new builder instance
-
reader
Return a default JSON-P entity reader.- Returns:
- default JSON-P body reader instance
-
reader
Create a new JSON-P entity reader based onJsonReaderFactory
.- Parameters:
readerFactory
- json reader factory- Returns:
- new JSON-P body reader instance
-
writer
Return a default JSON-P entity writer.- Returns:
- default JSON-P body writer instance
-
writer
Create a new JSON-P entity writer based onJsonWriterFactory
.- Parameters:
writerFactory
- json writer factory- Returns:
- new JSON-P body writer instance
-
streamWriter
Return a default JSON-P entity stream writer.- Returns:
- default JSON-P body stream writer instance
-
streamWriter
Create a new JSON-P entity stream writer based onJsonWriterFactory
.- Parameters:
writerFactory
- json writer factory- Returns:
- new JSON-P stream body writer instance
-
eventStreamWriter
Return a default JSON-P entity event stream writer. This writer is forMediaType.TEXT_EVENT_STREAM
content type.- Returns:
- new JSON-P body stream writer instance
-
eventStreamWriter
public static MessageBodyStreamWriter<JsonStructure> eventStreamWriter(JsonWriterFactory writerFactory) Create a new JSON-P entity stream writer based onJsonWriterFactory
instance. This writer is forMediaType.TEXT_EVENT_STREAM
content type.- Parameters:
writerFactory
- json writer factory- Returns:
- new JSON-P body stream writer instance
-
ndJsonStreamWriter
Return a default JSON-P entity event stream writer. This writer is forMediaType.APPLICATION_X_NDJSON
content type.- Returns:
- new JSON-P body stream writer instance
-
ndJsonStreamWriter
public static MessageBodyStreamWriter<JsonStructure> ndJsonStreamWriter(JsonWriterFactory writerFactory) Create a new JSON-P entity stream writer based onJsonWriterFactory
instance. This writer is forMediaType.APPLICATION_X_NDJSON
content type.- Parameters:
writerFactory
- json writer factory- Returns:
- new JSON-P body stream writer instance
-
readerInstance
Return JSON-P reader instance.- Returns:
- JSON-P reader instance
-
writerInstance
Return JSON-P entity writer.- Returns:
- JSON-P writer instance
-
streamWriterInstance
Return JSON-P stream writer.This stream writer supports
publishers
ofJsonStructure
(such asJsonObject
), writing them as an array of JSONs.- Returns:
- JSON processing stream writer.
-
eventStreamWriterInstance
Return JSON-P stream writer.This stream writer supports
publishers
ofJsonStructure
(such asJsonObject
), writing them as separate entries in the following format:
This writer is fordata: {"json":"data"}\n \n data: {"json2":"data2"}\n \n
MediaType.TEXT_EVENT_STREAM
content type.- Returns:
- JSON processing stream writer.
-
ndJsonStreamWriterInstance
Return JSON-P stream writer.This stream writer supports
publishers
ofJsonStructure
(such asJsonObject
), writing them as separate entries in the following format:
This writer is for{"json":"data"}\n {"json2":"data2"}
MediaType.APPLICATION_X_NDJSON
content type.- Returns:
- JSON processing stream writer.
-
readers
Description copied from interface:MediaSupport
Returns the collection of the readers which should be registered.- Specified by:
readers
in interfaceMediaSupport
- Returns:
- readers
-
writers
Description copied from interface:MediaSupport
Returns the collection of the writers which should be registered.- Specified by:
writers
in interfaceMediaSupport
- Returns:
- writers
-
streamWriters
Description copied from interface:MediaSupport
Returns the collection of the stream writers which should be registered.- Specified by:
streamWriters
in interfaceMediaSupport
- Returns:
- stream writers
-