- java.lang.Object
-
- io.helidon.media.jsonb.JsonbSupport
-
- All Implemented Interfaces:
MediaSupport
public final class JsonbSupport extends Object implements MediaSupport
Support for JSON-B integration. For usage examples navigate to theMediaSupport
.- See Also:
Jsonb
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonbSupport
create()
Creates a newJsonbSupport
.static JsonbSupport
create(Jsonb jsonb)
Creates a newJsonbSupport
.static MessageBodyStreamWriter<Object>
eventStreamWriter()
Return a default JSON-B entity event stream writer.static MessageBodyStreamWriter<Object>
eventStreamWriter(Jsonb jsonb)
Create a new JSON-B entity stream writer based onJsonb
instance.MessageBodyStreamWriter<Object>
eventStreamWriterInstance()
Return JSON-B stream writer instance forMediaType.TEXT_EVENT_STREAM
content type.static MessageBodyStreamWriter<Object>
ndJsonStreamWriter()
Return a default JSON-B entity event stream writer.static MessageBodyStreamWriter<Object>
ndJsonStreamWriter(Jsonb jsonb)
Create a new JSON-B entity stream writer based onJsonb
instance.MessageBodyStreamWriter<Object>
ndJsonStreamWriterInstance()
Return JSON-B stream writer instance forMediaType.APPLICATION_X_NDJSON
content type.static MessageBodyReader<Object>
reader()
Return a default JSON-B entity reader.static MessageBodyReader<Object>
reader(Jsonb jsonb)
Create a new JSON-B entity reader based onJsonb
instance.MessageBodyReader<Object>
readerInstance()
Return JSON-B reader instance.Collection<MessageBodyReader<?>>
readers()
Returns the collection of the readers which should be registered.static MessageBodyStreamWriter<Object>
streamWriter()
Return a default JSON-B entity stream writer.static MessageBodyStreamWriter<Object>
streamWriter(Jsonb jsonb)
Create a new JSON-B entity stream writer based onJsonb
instance.MessageBodyStreamWriter<Object>
streamWriterInstance()
Return JSON-B stream writer instance.Collection<MessageBodyStreamWriter<?>>
streamWriters()
Returns the collection of the stream writers which should be registered.static MessageBodyWriter<Object>
writer()
Return a default JSON-B entity writer.static MessageBodyWriter<Object>
writer(Jsonb jsonb)
Create a new JSON-B entity writer based onJsonb
instance.MessageBodyWriter<Object>
writerInstance()
Return JSON-B writer instance.Collection<MessageBodyWriter<?>>
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 Detail
-
create
public static JsonbSupport create()
Creates a newJsonbSupport
.- Returns:
- a new
JsonbSupport
-
create
public static JsonbSupport create(Jsonb jsonb)
Creates a newJsonbSupport
.- Parameters:
jsonb
- the JSON-B to use; must not benull
- Returns:
- a new
JsonbSupport
- Throws:
NullPointerException
- ifjsonb
isnull
-
reader
public static MessageBodyReader<Object> reader()
Return a default JSON-B entity reader.- Returns:
- default JSON-B body writer instance
-
reader
public static MessageBodyReader<Object> reader(Jsonb jsonb)
Create a new JSON-B entity reader based onJsonb
instance.- Parameters:
jsonb
- jsonb instance- Returns:
- new JSON-B body reader instance
-
writer
public static MessageBodyWriter<Object> writer()
Return a default JSON-B entity writer.- Returns:
- default JSON-B body writer instance
-
writer
public static MessageBodyWriter<Object> writer(Jsonb jsonb)
Create a new JSON-B entity writer based onJsonb
instance.- Parameters:
jsonb
- jsonb instance- Returns:
- new JSON-B body writer instance
-
streamWriter
public static MessageBodyStreamWriter<Object> streamWriter()
Return a default JSON-B entity stream writer.- Returns:
- default JSON-B body writer stream instance
-
streamWriter
public static MessageBodyStreamWriter<Object> streamWriter(Jsonb jsonb)
Create a new JSON-B entity stream writer based onJsonb
instance.- Parameters:
jsonb
- jsonb instance- Returns:
- new JSON-B body stream writer instance
-
eventStreamWriter
public static MessageBodyStreamWriter<Object> eventStreamWriter()
Return a default JSON-B entity event stream writer. This writer is forMediaType.TEXT_EVENT_STREAM
content type.- Returns:
- new JSON-B body stream writer instance
-
eventStreamWriter
public static MessageBodyStreamWriter<Object> eventStreamWriter(Jsonb jsonb)
Create a new JSON-B entity stream writer based onJsonb
instance. This writer is forMediaType.TEXT_EVENT_STREAM
content type.- Parameters:
jsonb
- jsonb instance- Returns:
- new JSON-B body stream writer instance
-
ndJsonStreamWriter
public static MessageBodyStreamWriter<Object> ndJsonStreamWriter()
Return a default JSON-B entity event stream writer. This writer is forMediaType.APPLICATION_X_NDJSON
content type.- Returns:
- new JSON-B body stream writer instance
-
ndJsonStreamWriter
public static MessageBodyStreamWriter<Object> ndJsonStreamWriter(Jsonb jsonb)
Create a new JSON-B entity stream writer based onJsonb
instance. This writer is forMediaType.APPLICATION_X_NDJSON
content type.- Parameters:
jsonb
- jsonb instance- Returns:
- new JSON-B body stream writer instance
-
readerInstance
public MessageBodyReader<Object> readerInstance()
Return JSON-B reader instance.- Returns:
- JSON-B reader instance
-
writerInstance
public MessageBodyWriter<Object> writerInstance()
Return JSON-B writer instance.- Returns:
- JSON-B writer instance
-
streamWriterInstance
public MessageBodyStreamWriter<Object> streamWriterInstance()
Return JSON-B stream writer instance.- Returns:
- JSON-B stream writer instance
-
eventStreamWriterInstance
public MessageBodyStreamWriter<Object> eventStreamWriterInstance()
Return JSON-B stream writer instance forMediaType.TEXT_EVENT_STREAM
content type.- Returns:
- JSON-B event stream writer instance
-
ndJsonStreamWriterInstance
public MessageBodyStreamWriter<Object> ndJsonStreamWriterInstance()
Return JSON-B stream writer instance forMediaType.APPLICATION_X_NDJSON
content type.- Returns:
- JSON-B event stream writer instance
-
readers
public Collection<MessageBodyReader<?>> readers()
Description copied from interface:MediaSupport
Returns the collection of the readers which should be registered.- Specified by:
readers
in interfaceMediaSupport
- Returns:
- readers
-
writers
public Collection<MessageBodyWriter<?>> writers()
Description copied from interface:MediaSupport
Returns the collection of the writers which should be registered.- Specified by:
writers
in interfaceMediaSupport
- Returns:
- writers
-
streamWriters
public Collection<MessageBodyStreamWriter<?>> 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
-
-