Class AbstractConfigSource
java.lang.Object
io.helidon.config.AbstractSource
io.helidon.config.AbstractConfigSource
- All Implemented Interfaces:
ConfigSource, Source, Supplier<ConfigSource>
- Direct Known Subclasses:
ClasspathConfigSource, DirectoryConfigSource, FileConfigSource, 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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Source
Source.Builder<B>Modifier and TypeInterfaceDescriptionstatic interfaceSource.Builder<B extends Source.Builder<B>>Configurable options of aSource. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConfigSource(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 AbstractSource
changeWatcher, description, optional, pollingStrategy, retryPolicy, uidModifier and TypeMethodDescriptionprotected Optional<ChangeWatcher<Object>> A change watcher of this source, if it implementsWatchableSourceand has one configured.Short, human-readable summary referring to the underlying source.booleanoptional()Whether this source is optional.protected Optional<PollingStrategy> A polling strategy of this source, if it implementsPollableSourceand has one configured.Retry policy configured on this config source.protected Stringuid()Returns universal id of source to be used to constructAbstractSource.description().Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ConfigSource
get, initModifier and TypeMethodDescriptiondefault ConfigSourceget()default voidinit(ConfigContext context) Initialize the config source with aConfigContext.
-
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
-