Interface ConfigSource
- All Known Subinterfaces:
MutableConfigSource
- All Known Implementing Classes:
DefaultConfigSource
public interface ConfigSource
Interface that contains the source of configuration data.
All configuration data is organized relative to handle paths so that a
source is expected to know the handle paths of all the data it manages,
as well as the configuration data relative to a handle path.
- Since:
- 1.0
- Version:
- 2022-08-30
-
Method Summary
Modifier and TypeMethodDescriptionvoid
gatherConfigForPath
(String path, Map<String, String> config) Put all configuration data for the specified handle path into the supplied map.void
gatherConfigPaths
(Set<String> paths) Put all available config bean handle paths into the supplied set.default void
gatherOptionsForPath
(String path, Map<String, String> map) Put all option data for the specified handle path into the supplied map.default void
gatherOptionsPaths
(Set<String> paths) Put all available option bean handle paths into the supplied set.void
getConfigValue
(String path, String attr, ConfigValue value) Populate the specified value bean with the effective value of the specified attribute from this source.default String
getName()
Returns the name of the source.int
getRank()
Returns the rank of the source, which is used to order sources.
-
Method Details
-
getName
Returns the name of the source. Generally speaking, this should be unique among the list of sources. -
getRank
int getRank()Returns the rank of the source, which is used to order sources. Sources with higher ranks override sources with lower ranks. -
gatherConfigPaths
Put all available config bean handle paths into the supplied set. -
gatherConfigForPath
Put all configuration data for the specified handle path into the supplied map. The keys in the map are bean attribute names in dotted notation, and the values are the corresponding values for the attributes.- Parameters:
path
- the handle path to return data forconfig
- map to hold the resulting config data
-
getConfigValue
Populate the specified value bean with the effective value of the specified attribute from this source.- Parameters:
path
- the handle path to return data forattr
- the attribute of the config to returnvalue
- the value to populate
-
gatherOptionsPaths
Put all available option bean handle paths into the supplied set. Most sources don't support this so by default it does nothing. -
gatherOptionsForPath
Put all option data for the specified handle path into the supplied map. The keys in the map are bean attribute names in dotted notation, and the values are the corresponding options for the attributes. Map, list and array bean attributes will contain*
wildcards as all values in the map, list or array are assumed to be the same type. Most sources don't suppor this so by default it does nothing.- Parameters:
path
- the handle path to return data formap
- map to put the options into
-