Package io.helidon.config.spi
Class AbstractParsableConfigSource<S>
- java.lang.Object
-
- io.helidon.config.spi.AbstractSource<ConfigNode.ObjectNode,S>
-
- io.helidon.config.spi.AbstractConfigSource<S>
-
- io.helidon.config.spi.AbstractParsableConfigSource<S>
-
- Type Parameters:
S- a type of data stamp
- All Implemented Interfaces:
Changeable<ConfigNode.ObjectNode>,ConfigSource,Source<ConfigNode.ObjectNode>,AutoCloseable,Supplier<ConfigSource>
- Direct Known Subclasses:
EtcdConfigSource,GitConfigSource
public abstract class AbstractParsableConfigSource<S> extends AbstractConfigSource<S>
Abstract implementation ofConfigSourcethat uses aConfigParserto parseconfiguration contentaccessible as aReadable.Typically concrete implementations will extend this class in order to delegate to
ConfigParserthe loading of configuration content into anConfigNode.ObjectNoderepresenting the hierarchical structure of the configuration.- See Also:
AbstractParsableConfigSource.Builder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractParsableConfigSource.Builder<B extends AbstractParsableConfigSource.Builder<B,T>,T>CommonAbstractParsableConfigSourceBuilder, suitable for concrete implementations of Builder that are related toConfigSources which extendAbstractParsableConfigSource-
Nested classes/interfaces inherited from class io.helidon.config.spi.AbstractSource
AbstractSource.Data<D,S>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractParsableConfigSource(AbstractParsableConfigSource.Builder builder)Initializes config source from builder.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ConfigParser.Content<S>content()Returns config source content.protected AbstractSource.Data<ConfigNode.ObjectNode,S>loadData()Loads new data from config source.protected StringmediaType()Returns source associated media type ornullif unknown.protected ConfigParserparser()Returns source associated parser ornullif unknown.-
Methods inherited from class io.helidon.config.spi.AbstractConfigSource
changes, configContext, init, processLoadedData
-
Methods inherited from class io.helidon.config.spi.AbstractSource
dataStamp, description, fireChangeEvent, isMandatory, load, uid
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.config.spi.ConfigSource
get
-
Methods inherited from interface io.helidon.config.spi.Source
close, description, load
-
-
-
-
Constructor Detail
-
AbstractParsableConfigSource
protected AbstractParsableConfigSource(AbstractParsableConfigSource.Builder builder)
Initializes config source from builder.- Parameters:
builder- builder to be initialized from
-
-
Method Detail
-
loadData
protected AbstractSource.Data<ConfigNode.ObjectNode,S> loadData()
Description copied from class:AbstractSourceLoads new data from config source.- Specified by:
loadDatain classAbstractSource<ConfigNode.ObjectNode,S>- Returns:
- newly loaded data with appropriate data timestamp used for future method calls
-
mediaType
protected String mediaType()
Returns source associated media type ornullif unknown.- Returns:
- source associated media type or
nullif unknown.
-
parser
protected ConfigParser parser()
Returns source associated parser ornullif unknown.- Returns:
- source associated parser or
nullif unknown.
-
content
protected abstract ConfigParser.Content<S> content() throws ConfigException
Returns config source content.- Returns:
- config source content. Never returns
null. - Throws:
ConfigException- in case of loading of configuration from config source failed.
-
-