java.lang.Object
io.helidon.config.PrefixedConfigSource
- All Implemented Interfaces:
- ConfigSource,- EventConfigSource,- NodeConfigSource,- Source,- Supplier<ConfigSource>
public final class PrefixedConfigSource
extends Object
implements ConfigSource, NodeConfigSource, EventConfigSource
ConfigSource implementation wraps another config source and add key prefix to original one.
 Only supports "eager" config sources, such as ParsableSource
  and NodeConfigSource.- 
Nested Class SummaryNested classes/interfaces inherited from interface io.helidon.config.spi.SourceSource.Builder<B extends Source.Builder<B>>
- 
Method SummaryModifier and TypeMethodDescriptionstatic PrefixedConfigSourceCreate a prefixed config source from meta configuration.static PrefixedConfigSourcecreate(String key, ConfigSource source) Create a new prefixed config source.Short, human-readable summary referring to the underlying source.booleanexists()If the underlying data exist at this time.voidinit(ConfigContext context) Initialize the config source with aConfigContext.load()Loads the underlying source data.voidonChange(BiConsumer<String, ConfigNode> changedNode) Register a change listener.booleanoptional()Whether this source is optional.Retry policy configured on this config source.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.config.spi.ConfigSourceget
- 
Method Details- 
createCreate a prefixed config source from meta configuration. The meta configuration must contain the configuration key "key" and meta configuration of another config source to be prefixed with the key.- Parameters:
- metaConfig- meta configuration
- Returns:
- a new prefixed config source
 
- 
createCreate a new prefixed config source.- Parameters:
- key- prefix key
- source- wrapped source
- Returns:
- a new prefixed config source
 
- 
initDescription copied from interface:ConfigSourceInitialize the config source with aConfigContext.The method is executed during Configbootstrapping byConfig.Builder.- Specified by:
- initin interface- ConfigSource
- Parameters:
- context- a config context
 
- 
descriptionDescription copied from interface:SourceShort, human-readable summary referring to the underlying source.For example, a file path or a URL or any other information that helps the user recognize the underlying origin of the data this Sourceprovides.Default is the implementation class simple name with any "Source"suffix removed.- Specified by:
- descriptionin interface- Source
- Returns:
- description of the source
 
- 
loadDescription copied from interface:NodeConfigSourceLoads the underlying source data. This method is only called when the sourceSource.exists().The method can be invoked repeatedly, for example during retries. - Specified by:
- loadin interface- NodeConfigSource
- 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
 
- 
onChangeDescription copied from interface:EventConfigSourceRegister a change listener.- Specified by:
- onChangein interface- EventConfigSource
- Parameters:
- changedNode- the key and node of the configuration that changed. This may be the whole config tree, or a specific node depending on how fine grained the detection mechanism is. To notify of a whole node being changed, use empty string as a key
 
- 
existspublic boolean exists()Description copied from interface:SourceIf the underlying data exist at this time. This is to prevent us loading such a source if we know it does not exist.
- 
retryPolicyDescription copied from interface:SourceRetry policy configured on this config source.- Specified by:
- retryPolicyin interface- Source
- Returns:
- configured retry policy
 
- 
optionalpublic boolean optional()Description copied from interface:SourceWhether this source is optional.
 
-