java.lang.Object
io.helidon.config.AbstractSource
io.helidon.config.AbstractConfigSource
io.helidon.config.ClasspathConfigSource
- All Implemented Interfaces:
- ConfigSource,- ParsableSource,- Source,- Supplier<ConfigSource>
public class ClasspathConfigSource
extends AbstractConfigSource
implements ConfigSource, ParsableSource
ConfigSource implementation that loads configuration content from a resource on a classpath.
 Classpath config source does not support changes (neither through polling nor through change notifications).- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classClasspath ConfigSource Builder.
- 
Method SummaryModifier and TypeMethodDescriptionbuilder()Create a new fluent API builder for classpath config source.static ClasspathConfigSourceInitializes config source instance from configuration properties.static ClasspathConfigSourceCreate a config source for the first resource on the classpath.static List<ConfigSource> Create config source for each resource on the classpath.static Collection<? super ClasspathConfigSource> Create config source for each resource on the classpath.load()Loads the underlying source data.Media type if on eis configured for parsing content ofParsableSource.parser()Config parser if one is configured to use for parsing content ofParsableSource.Resolve relative resource to the current resource.toString()protected Stringuid()Returns universal id of source to be used to constructAbstractSource.description().Methods inherited from class io.helidon.config.AbstractSourcechangeWatcher, description, optional, pollingStrategy, retryPolicyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.config.spi.ConfigSourceget, initMethods inherited from interface io.helidon.config.spi.Sourcedescription, exists, optional, retryPolicy
- 
Method Details- 
createpublic static ClasspathConfigSource create(Config metaConfig) throws ConfigMappingException, MissingValueException Initializes config source instance from configuration properties.Mandatory properties, seeConfigSources.classpath(String):- resource- type- String
 properties: seeAbstractConfigSourceBuilder.config(io.helidon.config.Config).- Parameters:
- metaConfig- meta-configuration used to initialize returned config source instance from.
- Returns:
- new instance of config source described by metaConfig
- Throws:
- MissingValueException- in case the configuration tree does not contain all expected sub-nodes required by the mapper implementation to provide instance of Java type.
- ConfigMappingException- in case the mapper fails to map the (existing) configuration tree represented by the supplied configuration node to an instance of a given Java type.
- See Also:
 
- 
createCreate a config source for the first resource on the classpath.- Parameters:
- resource- resource to find
- Returns:
- a config source based on the classpath resource
 
- 
createAllCreate config source for each resource on the classpath.- Parameters:
- resource- resource to find
- Returns:
- a collection of sources for each resource present on the classpath, always at least one
 
- 
createAllCreate config source for each resource on the classpath.- Parameters:
- metaConfig- meta configuration of the config source
- Returns:
- a collection of sources for each resource present on the classpath
 
- 
builderCreate a new fluent API builder for classpath config source.- Returns:
- a new builder instance
 
- 
uidDescription copied from class:AbstractSourceReturns universal id of source to be used to constructAbstractSource.description().- Overrides:
- uidin class- AbstractSource
- Returns:
- universal id of source
 
- 
loadDescription copied from interface:ParsableSourceLoads the underlying source data. This method is only called when the sourceSource.exists().The method can be invoked repeatedly, for example during retries. In case the underlying data is gone or does not exist, return an empty optional. - Specified by:
- loadin interface- ParsableSource
- Returns:
- An instance of Tas read from the underlying origin of the data (if it exists)
- Throws:
- ConfigException- in case of errors loading from the underlying origin
 
- 
relativeResolverDescription copied from interface:ParsableSourceResolve relative resource to the current resource.- Specified by:
- relativeResolverin interface- ParsableSource
- Returns:
- a function to resolve resource name into an input stream
 
- 
toString- Overrides:
- toStringin class- AbstractConfigSource
 
- 
mediaTypeDescription copied from class:AbstractConfigSourceMedia 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.- Specified by:
- mediaTypein interface- ParsableSource
- Overrides:
- mediaTypein class- AbstractConfigSource
- Returns:
- configured media type or empty if none configured
 
- 
parserDescription copied from class:AbstractConfigSourceConfig 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 onAbstractConfigSource.mediaType().- Specified by:
- parserin interface- ParsableSource
- Overrides:
- parserin class- AbstractConfigSource
- Returns:
- a configured parser, or empty if one should be chosen from media type (or if this is not a parsable source)
 
 
-