B - type of Builder implementationT - type of key source attributes (target) used to construct polling strategy fromEtcdConfigSourceBuilder, GitConfigSourceBuilderpublic abstract static class AbstractParsableConfigSource.Builder<B extends AbstractParsableConfigSource.Builder<B,T>,T> extends AbstractConfigSource.Builder<B,T>
AbstractParsableConfigSource Builder, suitable for
concrete implementations of Builder that are related to
ConfigSources which extend AbstractParsableConfigSource
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 appropriate ConfigParser;parser - the ConfigParser to be used to parse the sourceexecutor and subscriber's buffer size - behavior related to
AbstractConfigSource.changes() support
If the ConfigSource is mandatory and a source does not exist
then Source.load() throws a ConfigException.
If the application does not explicit set media-type the
Builder tries to infer it from the source, for example from the
source URI.
| Modifier | Constructor | Description |
|---|---|---|
protected |
Builder(java.lang.Class<T> targetType) |
Initialize builder.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.String |
getMediaType() |
Returns media type property.
|
protected ConfigParser |
getParser() |
Returns parser property.
|
protected B |
init(Config metaConfig) |
Initialize builder from specified configuration properties.
|
B |
mediaType(java.lang.String mediaType) |
Sets configuration content media type.
|
B |
parser(ConfigParser parser) |
Sets a
ConfigParser instance to be used to parse configuration content. |
get, getMediaTypeMapping, getParserMapping, mediaTypeMapping, parserMappingbuild, changesExecutor, changesMaxBuffer, getChangesExecutor, getChangesMaxBuffer, getPollingStrategy, getRetryPolicy, getTarget, isMandatory, optional, pollingStrategy, pollingStrategy, retryPolicyprotected Builder(java.lang.Class<T> targetType)
targetType - target typeprotected B init(Config metaConfig)
Supported configuration properties:
optional - type boolean, see AbstractSource.Builder.optional()polling-strategy - see PollingStrategy for details about configuration format,
see AbstractSource.Builder.pollingStrategy(Supplier) or AbstractSource.Builder.pollingStrategy(Function)media-type-mapping - type Map - key to media type, see AbstractConfigSource.Builder.mediaTypeMapping(Function)media-type - type String, see mediaType(String)init in class AbstractConfigSource.Builder<B extends AbstractParsableConfigSource.Builder<B,T>,T>metaConfig - configuration properties used to initialize a builder instance.public B mediaType(java.lang.String mediaType)
mediaType - a configuration content media typepublic B parser(ConfigParser parser)
ConfigParser instance to be used to parse configuration content.
If the parser is set, the media type property is ignored.
parser - parsed used to parse configuration contentprotected java.lang.String getMediaType()
protected ConfigParser getParser()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.