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 ofConfigSource
that uses aConfigParser
to parseconfiguration content
accessible as aReadable
.Typically concrete implementations will extend this class in order to delegate to
ConfigParser
the loading of configuration content into anConfigNode.ObjectNode
representing the hierarchical structure of the configuration.- See Also:
AbstractParsableConfigSource.Builder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractParsableConfigSource.Builder<B extends AbstractParsableConfigSource.Builder<B,T>,T>
CommonAbstractParsableConfigSource
Builder, suitable for concrete implementations of Builder that are related toConfigSource
s which extendAbstractParsableConfigSource
-
Nested classes/interfaces inherited from class io.helidon.config.spi.AbstractSource
AbstractSource.Data<D,S>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractParsableConfigSource(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 String
mediaType()
Returns source associated media type ornull
if unknown.protected ConfigParser
parser()
Returns source associated parser ornull
if 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:AbstractSource
Loads new data from config source.- Specified by:
loadData
in 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 ornull
if unknown.- Returns:
- source associated media type or
null
if unknown.
-
parser
protected ConfigParser parser()
Returns source associated parser ornull
if unknown.- Returns:
- source associated parser or
null
if 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.
-
-