- java.lang.Object
-
- io.helidon.media.jackson.JacksonSupport
-
- All Implemented Interfaces:
MediaSupport
public final class JacksonSupport extends Object implements MediaSupport
Support for Jackson integration. For usage examples navigate to theMediaSupport
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JacksonSupport
create()
Creates a newJacksonSupport
.static JacksonSupport
create(ObjectMapper objectMapper)
Creates a newJacksonSupport
.static MessageBodyStreamWriter<Object>
eventStreamWriter()
Return a default Jackson entity event stream writer.static MessageBodyStreamWriter<Object>
eventStreamWriter(ObjectMapper objectMapper)
Create a new Jackson entity stream writer based onObjectMapper
instance.MessageBodyStreamWriter<Object>
eventStreamWriterInstance()
Return Jackson stream writer instance forMediaType.TEXT_EVENT_STREAM
content type.static MessageBodyStreamWriter<Object>
ndJsonStreamWriter()
Return a default Jackson entity event stream writer.static MessageBodyStreamWriter<Object>
ndJsonStreamWriter(ObjectMapper objectMapper)
Create a new Jackson entity stream writer based onObjectMapper
instance.MessageBodyStreamWriter<Object>
ndJsonStreamWriterInstance()
Return Jackson stream writer instance forMediaType.APPLICATION_X_NDJSON
content type.static MessageBodyReader<Object>
reader()
Return a default Jackson entity reader.static MessageBodyReader<Object>
reader(ObjectMapper objectMapper)
Create a new Jackson entity reader based onObjectMapper
instance.MessageBodyReader<Object>
readerInstance()
Return Jackson reader instance.Collection<MessageBodyReader<?>>
readers()
Returns the collection of the readers which should be registered.static MessageBodyStreamWriter<Object>
streamWriter()
Return a default Jackson entity stream writer.static MessageBodyStreamWriter<Object>
streamWriter(ObjectMapper objectMapper)
Create a new Jackson entity stream writer based onObjectMapper
instance.MessageBodyStreamWriter<Object>
streamWriterInstance()
Return Jackson stream writer instance.Collection<MessageBodyStreamWriter<?>>
streamWriters()
Returns the collection of the stream writers which should be registered.static MessageBodyWriter<Object>
writer()
Return a default Jackson entity writer.static MessageBodyWriter<Object>
writer(ObjectMapper objectMapper)
Create a new Jackson entity writer based onObjectMapper
instance.MessageBodyWriter<Object>
writerInstance()
Return Jackson 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 JacksonSupport create()
Creates a newJacksonSupport
.- Returns:
- a new
JacksonSupport
-
create
public static JacksonSupport create(ObjectMapper objectMapper)
Creates a newJacksonSupport
.- Parameters:
objectMapper
- must not benull
- Returns:
- a new
JacksonSupport
-
reader
public static MessageBodyReader<Object> reader()
Return a default Jackson entity reader.- Returns:
- default Jackson body writer instance
-
reader
public static MessageBodyReader<Object> reader(ObjectMapper objectMapper)
Create a new Jackson entity reader based onObjectMapper
instance.- Parameters:
objectMapper
- object mapper instance- Returns:
- new Jackson body reader instance
-
writer
public static MessageBodyWriter<Object> writer()
Return a default Jackson entity writer.- Returns:
- default Jackson body writer instance
-
writer
public static MessageBodyWriter<Object> writer(ObjectMapper objectMapper)
Create a new Jackson entity writer based onObjectMapper
instance.- Parameters:
objectMapper
- object mapper instance- Returns:
- new Jackson body writer instance
-
streamWriter
public static MessageBodyStreamWriter<Object> streamWriter()
Return a default Jackson entity stream writer.- Returns:
- default Jackson body writer stream instance
-
streamWriter
public static MessageBodyStreamWriter<Object> streamWriter(ObjectMapper objectMapper)
Create a new Jackson entity stream writer based onObjectMapper
instance.- Parameters:
objectMapper
- object mapper instance- Returns:
- new Jackson body stream writer instance
-
eventStreamWriter
public static MessageBodyStreamWriter<Object> eventStreamWriter()
Return a default Jackson entity event stream writer. This writer is forMediaType.TEXT_EVENT_STREAM
content type.- Returns:
- new Jackson body stream writer instance
-
eventStreamWriter
public static MessageBodyStreamWriter<Object> eventStreamWriter(ObjectMapper objectMapper)
Create a new Jackson entity stream writer based onObjectMapper
instance. This writer is forMediaType.TEXT_EVENT_STREAM
content type.- Parameters:
objectMapper
- object mapper instance- Returns:
- new Jackson body stream writer instance
-
ndJsonStreamWriter
public static MessageBodyStreamWriter<Object> ndJsonStreamWriter()
Return a default Jackson entity event stream writer. This writer is forMediaType.APPLICATION_X_NDJSON
content type.- Returns:
- new Jackson body stream writer instance
-
ndJsonStreamWriter
public static MessageBodyStreamWriter<Object> ndJsonStreamWriter(ObjectMapper objectMapper)
Create a new Jackson entity stream writer based onObjectMapper
instance. This writer is forMediaType.APPLICATION_X_NDJSON
content type.- Parameters:
objectMapper
- object mapper instance- Returns:
- new Jackson body stream writer instance
-
readerInstance
public MessageBodyReader<Object> readerInstance()
Return Jackson reader instance.- Returns:
- Jackson reader instance
-
writerInstance
public MessageBodyWriter<Object> writerInstance()
Return Jackson writer instance.- Returns:
- Jackson writer instance
-
streamWriterInstance
public MessageBodyStreamWriter<Object> streamWriterInstance()
Return Jackson stream writer instance.- Returns:
- Jackson stream writer instance
-
eventStreamWriterInstance
public MessageBodyStreamWriter<Object> eventStreamWriterInstance()
Return Jackson stream writer instance forMediaType.TEXT_EVENT_STREAM
content type.- Returns:
- Jackson event stream writer instance
-
ndJsonStreamWriterInstance
public MessageBodyStreamWriter<Object> ndJsonStreamWriterInstance()
Return Jackson stream writer instance forMediaType.APPLICATION_X_NDJSON
content type.- Returns:
- Jackson 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
-
-