java.lang.Object
io.helidon.media.common.MediaContext.Builder
- All Implemented Interfaces:
Builder<MediaContext.Builder,
,MediaContext> MediaContextBuilder<MediaContext.Builder>
,Supplier<MediaContext>
- Enclosing class:
- MediaContext
public static class MediaContext.Builder
extends Object
implements Builder<MediaContext.Builder,MediaContext>, MediaContextBuilder<MediaContext.Builder>
MediaSupport builder.
-
Method Summary
Modifier and TypeMethodDescriptionaddMediaSupport
(MediaSupport mediaSupport) Adds new instance ofMediaSupport
.addMediaSupport
(MediaSupport mediaSupport, int priority) Adds new instance ofMediaSupport
with specific priority.addReader
(MessageBodyReader<?> reader) Registers new reader.addStreamReader
(MessageBodyStreamReader<?> streamReader) Registers new stream reader.addStreamWriter
(MessageBodyStreamWriter<?> streamWriter) Registers new stream writer.addWriter
(MessageBodyWriter<?> writer) Registers new writer.build()
Build the instance from this builder.Configures thisMediaContext.Builder
from the suppliedConfig
.discoverServices
(boolean discoverServices) Whether Java Service Loader should be used to loadMediaSupportProvider
.filterServices
(boolean filterServices) Whether services loaded by Java Service Loader should be filtered.registerDefaults
(boolean registerDefaults) Whether default readers and writers 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.MediaContextBuilder
addMediaSupport, addReader, addStreamReader, addStreamWriter, addWriter
-
Method Details
-
config
Configures thisMediaContext.Builder
from the suppliedConfig
.Optional configuration parameters key description register-defaults Whether to register default reader and writers discover-services Whether to discover services via service loader filter-services Whether to filter discovered services by service names in services section services Configuration section for each service. Each entry has to have "name" parameter. It is also used for filtering of loaded services. - Parameters:
config
- aConfig
- Returns:
- this
MediaContext.Builder
-
addMediaSupport
Description copied from interface:MediaContextBuilder
Adds new instance ofMediaSupport
.- Specified by:
addMediaSupport
in interfaceMediaContextBuilder<MediaContext.Builder>
- Parameters:
mediaSupport
- media support- Returns:
- updated instance of the builder
-
addMediaSupport
Adds new instance ofMediaSupport
with specific priority.- Parameters:
mediaSupport
- media supportpriority
- priority- Returns:
- updated instance of the builder
-
addReader
Description copied from interface:MediaContextBuilder
Registers new reader.- Specified by:
addReader
in interfaceMediaContextBuilder<MediaContext.Builder>
- Parameters:
reader
- reader- Returns:
- updated instance of the builder
-
addStreamReader
Description copied from interface:MediaContextBuilder
Registers new stream reader.- Specified by:
addStreamReader
in interfaceMediaContextBuilder<MediaContext.Builder>
- Parameters:
streamReader
- stream reader- Returns:
- updated instance of the builder
-
addWriter
Description copied from interface:MediaContextBuilder
Registers new writer.- Specified by:
addWriter
in interfaceMediaContextBuilder<MediaContext.Builder>
- Parameters:
writer
- writer- Returns:
- updated instance of the builder
-
addStreamWriter
Description copied from interface:MediaContextBuilder
Registers new stream writer.- Specified by:
addStreamWriter
in interfaceMediaContextBuilder<MediaContext.Builder>
- Parameters:
streamWriter
- stream writer- Returns:
- updated instance of the builder
-
registerDefaults
Whether default readers and writers should be registered.- Parameters:
registerDefaults
- register defaults- Returns:
- this builder instance
-
discoverServices
Whether Java Service Loader should be used to loadMediaSupportProvider
.- Parameters:
discoverServices
- use Java Service Loader- Returns:
- this builder instance
-
filterServices
Whether services loaded by Java Service Loader should be filtered. All of the services which should pass the filter, have to be present underservices
section of configuration.- Parameters:
filterServices
- filter services- Returns:
- this builder instance
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<MediaContext.Builder,
MediaContext> - Returns:
- instance of the built type
-