- All Superinterfaces:
RuntimeType.Api<MediaContextConfig>
Media context to obtain readers and writers of various supported content types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MediaContextConfig.Builder
builder()
Builder to set up this media support context.static MediaContext
create()
Create a new media context fromServiceLoader
.static MediaContext
Create a new media context and apply provided configuration.static MediaContext
create
(MediaContextConfig config) Create media context from its prototype.static MediaContext
create
(Consumer<MediaContextConfig.Builder> consumer) Create media context, customizing its configuration.<T> EntityReader
<T> reader
(GenericType<T> type, Headers headers) Reader for entity.<T> EntityReader
<T> reader
(GenericType<T> type, Headers requestHeaders, Headers responseHeaders) Reader for client response entity.<T> EntityWriter
<T> writer
(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders) Writer for server response entity.<T> EntityWriter
<T> writer
(GenericType<T> type, WritableHeaders<?> requestHeaders) Writer for client request entity.Methods inherited from interface io.helidon.builder.api.RuntimeType.Api
prototype
-
Method Details
-
create
Create a new media context fromServiceLoader
.- Returns:
- media context
-
create
Create a new media context and apply provided configuration.- Parameters:
config
- configuration to use- Returns:
- media context
-
create
Create media context from its prototype.- Parameters:
config
- media context configuration- Returns:
- a new media context
-
create
Create media context, customizing its configuration.- Parameters:
consumer
- consumer of media context builder- Returns:
- a new media context
-
builder
Builder to set up this media support context.- Returns:
- a new builder
-
reader
Reader for entity.- Type Parameters:
T
- type- Parameters:
type
- type to read into (such as Pojo, JsonObject)headers
- headers related to this entity- Returns:
- entity reader for the type, or a reader that will fail if none found
-
writer
<T> EntityWriter<T> writer(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders) Writer for server response entity.- Type Parameters:
T
- type- Parameters:
type
- type to writerequestHeaders
- request headers, containing accepted typesresponseHeaders
- response headers to be updated with content type- Returns:
- entity writer for the type, or a writer that will fail if none found
-
reader
Reader for client response entity.- Type Parameters:
T
- type- Parameters:
type
- type to read intorequestHeaders
- request headers containing accepted typesresponseHeaders
- response headers containing content type- Returns:
- entity reader for the type, or a reader that will fail if none found
-
writer
Writer for client request entity.- Type Parameters:
T
- type- Parameters:
type
- type to writerequestHeaders
- request headers to write content type to- Returns:
- entity writer for the type, or a writer that will fail if none found
-