- All Superinterfaces:
Prototype.Api
- All Known Subinterfaces:
GsonSupportConfig,io.helidon.http.media.gson.GsonSupportConfigBlueprint,JacksonSupportConfig,io.helidon.http.media.jackson.JacksonSupportConfigBlueprint,JsonBindingSupportConfig,io.helidon.http.media.json.binding.JsonBindingSupportConfigBlueprint,JsonbSupportConfig,io.helidon.http.media.jsonb.JsonbSupportConfigBlueprint,JsonpSupportConfig,io.helidon.http.media.jsonp.JsonpSupportConfigBlueprint,JsonSupportConfig,io.helidon.http.media.json.JsonSupportConfigBlueprint
- All Known Implementing Classes:
GsonSupportConfig.BuilderBase.GsonSupportConfigImpl,JacksonSupportConfig.BuilderBase.JacksonSupportConfigImpl,JsonBindingSupportConfig.BuilderBase.JsonBindingSupportConfigImpl,JsonbSupportConfig.BuilderBase.JsonbSupportConfigImpl,JsonpSupportConfig.BuilderBase.JsonpSupportConfigImpl,JsonSupportConfig.BuilderBase.JsonSupportConfigImpl,MediaSupportConfig.BuilderBase.MediaSupportConfigImpl
A set of configurable options expected to be used by each media support.
It is optional to extend this type in the configuration blueprint of each support.
Media types are used to check if a media support should be used for a specific request/response, and to configure the "Content-Type" header.
WebServer
- Reading of request entity - the content type of the request is usually checked against
acceptedMediaTypes(), and the type requested, and if both match, that support is used - Writing of response entity - the
contentType()is used as a value for the "Content-Type" header, and also validated against request "Accept" header values
WebClient
- Writing of request entity - the
contentType()is used as a value for the "Content-Type" header - Reading of response entity - the content type is validated against
acceptedMediaTypes(), and the type requested, and if both match, that support is used
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forMediaSupportConfig.static classMediaSupportConfig.BuilderBase<BUILDER extends MediaSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends MediaSupportConfig> Fluent API builder base forMediaSupportConfig. -
Method Summary
Modifier and TypeMethodDescriptionTypes accepted by this media support.static MediaSupportConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static MediaSupportConfig.Builderbuilder(MediaSupportConfig instance) Create a new fluent API builder from an existing instance.Content type to use if not configured (in response headers for server, and in request headers for client).static MediaSupportConfigDeprecated.static MediaSupportConfigCreate a new instance from configuration.name()Name of the support.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Deprecated.Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
name
String name()Name of the support. Each extension should provide its own default. This is to enable multiple instance of the same type.- Returns:
- name of the support
-
acceptedMediaTypes
Types accepted by this media support. When server processes the response, it checks theAcceptheader, to choose the right media support, if there are more supports available for the provided entity object.NOTE Make sure that you accept the type returned by
contentType().- Returns:
- accepted media types
-
contentType
HttpMediaType contentType()Content type to use if not configured (in response headers for server, and in request headers for client).- Returns:
- content type to use
-
create(io.helidon.config.Config)