java.lang.Object
io.helidon.config.AbstractSource
io.helidon.config.AbstractConfigSource
- All Implemented Interfaces:
ConfigSource
,Source
,Supplier<ConfigSource>
- Direct Known Subclasses:
AbstractSecretBundleConfigSource
,ClasspathConfigSource
,DirectoryConfigSource
,EtcdConfigSource
,FileConfigSource
,GitConfigSource
,MapConfigSource
,UrlConfigSource
A base implementation for config sources, that combines configuration from any type of a config source.
This class does not directly implement the interfaces - this is left to the implementer of the config source.
This class provides configuration methods as
protected
, so you can make them public in your implementation, to only
expose methods that must be implemented.
Other methods of the config source interfaces must be implemented by each source as they are data specific,
such as PollableSource.isModified(Object)
.
All other methods return reasonable defaults.
Config framework analyzes the config source based on interfaces it implements.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.config.spi.Source
Source.Builder<B extends Source.Builder<B>>
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractConfigSource
(AbstractConfigSourceBuilder<?, ?> builder) Use common data from the builder to setup media type, parser, media type mapping, and parser mapping on this instance. -
Method Summary
Modifier and TypeMethodDescriptionMedia type if on eis configured for parsing content ofParsableSource
.protected Optional<ConfigParser>
parser()
Config parser if one is configured to use for parsing content ofParsableSource
.toString()
Methods inherited from class io.helidon.config.AbstractSource
changeWatcher, description, optional, pollingStrategy, retryPolicy, uid
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.config.spi.ConfigSource
get, init
Methods inherited from interface io.helidon.config.spi.Source
description, exists, optional, retryPolicy
-
Constructor Details
-
AbstractConfigSource
Use common data from the builder to setup media type, parser, media type mapping, and parser mapping on this instance. Additional common data is handled byAbstractSource(AbstractSourceBuilder)
.- Parameters:
builder
- builder used to set up this config source
-
-
Method Details
-
mediaType
Media type if on eis configured for parsing content ofParsableSource
. If there is none configured (default), a parser is chosen based onConfigParser.Content.mediaType()
- media type detected during load of data.- Returns:
- configured media type or empty if none configured
-
parser
Config parser if one is configured to use for parsing content ofParsableSource
. If one is not configured on a source (default), a parser is chosen based onmediaType()
.- Returns:
- a configured parser, or empty if one should be chosen from media type (or if this is not a parsable source)
-
toString
-