Package io.helidon.config.spi
Class AbstractParsableConfigSource.Builder<B extends AbstractParsableConfigSource.Builder<B,T>,T>
- java.lang.Object
-
- io.helidon.config.spi.AbstractSource.Builder<B,T,ConfigSource>
-
- io.helidon.config.spi.AbstractConfigSource.Builder<B,T>
-
- io.helidon.config.spi.AbstractParsableConfigSource.Builder<B,T>
-
- Type Parameters:
B
- type of Builder implementationT
- type of key source attributes (target) used to construct polling strategy from
- All Implemented Interfaces:
Builder<ConfigSource>
,Supplier<ConfigSource>
- Direct Known Subclasses:
EtcdConfigSourceBuilder
,GitConfigSourceBuilder
- Enclosing class:
- AbstractParsableConfigSource<S>
public abstract static class AbstractParsableConfigSource.Builder<B extends AbstractParsableConfigSource.Builder<B,T>,T> extends AbstractConfigSource.Builder<B,T>
CommonAbstractParsableConfigSource
Builder, suitable for concrete implementations of Builder that are related toConfigSource
s which extendAbstractParsableConfigSource
The application can control the following behavior:
mandatory
- whether the configuration source must exist (default:true
)media-type
- configuration content media type to be used to look for appropriateConfigParser
;parser
- theConfigParser
to be used to parse the source- changes
executor
and subscriber'sbuffer size
- behavior related toAbstractConfigSource.changes()
support
If the
ConfigSource
ismandatory
and a source does not exist thenSource.load()
throws aConfigException
.If the application does not explicit set
media-type
theBuilder
tries to infer it from the source, for example from the source URI.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected B
init(Config metaConfig)
Initialize builder from specified configuration properties.protected String
mediaType()
Returns media type property.B
mediaType(String mediaType)
Sets configuration content media type.protected ConfigParser
parser()
Returns parser property.B
parser(ConfigParser parser)
Sets aConfigParser
instance to be used to parse configuration content.-
Methods inherited from class io.helidon.config.spi.AbstractConfigSource.Builder
get, mediaTypeMapping, mediaTypeMapping, parserMapping, parserMapping
-
Methods inherited from class io.helidon.config.spi.AbstractSource.Builder
build, changesExecutor, changesExecutor, changesMaxBuffer, changesMaxBuffer, isMandatory, optional, pollingStrategy, pollingStrategy, pollingStrategy, retryPolicy, retryPolicy, target, thisBuilder
-
-
-
-
Method Detail
-
init
protected B init(Config metaConfig)
Initialize builder from specified configuration properties.Supported configuration
properties
:optional
- typeboolean
, seeAbstractSource.Builder.optional()
polling-strategy
- seePollingStrategy
for details about configuration format, seeAbstractSource.Builder.pollingStrategy(Supplier)
orAbstractSource.Builder.pollingStrategy(Function)
media-type-mapping
- typeMap
- key to media type, seeAbstractConfigSource.Builder.mediaTypeMapping(Function)
media-type
- typeString
, seemediaType(String)
- Overrides:
init
in classAbstractConfigSource.Builder<B extends AbstractParsableConfigSource.Builder<B,T>,T>
- Parameters:
metaConfig
- configuration properties used to initialize a builder instance.- Returns:
- modified builder instance
-
mediaType
public B mediaType(String mediaType)
Sets configuration content media type.- Parameters:
mediaType
- a configuration content media type- Returns:
- modified builder instance
-
parser
public B parser(ConfigParser parser)
Sets aConfigParser
instance to be used to parse configuration content.If the parser is set, the
media type
property is ignored.- Parameters:
parser
- parsed used to parse configuration content- Returns:
- modified builder instance
-
mediaType
protected String mediaType()
Returns media type property.- Returns:
- media type property.
-
parser
protected ConfigParser parser()
Returns parser property.- Returns:
- parser property.
-
-