-
- All Known Implementing Classes:
EnvironmentVarsLoader,MapConfigLoader,PropertyLoader
public interface ConfigLoaderInterface for a config loader. Allows a loader to specify what types of configs it will load, property, environment variables, ect.. Each source has a format, and this will load the matching sources.A config loader knows how to load a specific format, so a property loader will load a stream of properties. An Environment Vars loader will load a list of Environment Variables.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanaccepts(java.lang.String format)True if the config loader accepts the format.default voidapplyConfig(GestaltConfig config)Apply the GestaltConfig to the Config Loader.GResultOf<java.util.List<ConfigNodeContainer>>loadSource(ConfigSource source)Load a ConfigSource then build the validated config node.java.lang.Stringname()Name of the config loader.
-
-
-
Method Detail
-
name
java.lang.String name()
Name of the config loader.- Returns:
- name
-
accepts
boolean accepts(java.lang.String format)
True if the config loader accepts the format.- Parameters:
format- config format.- Returns:
- True if the config loader accepts the format.
-
applyConfig
default void applyConfig(GestaltConfig config)
Apply the GestaltConfig to the Config Loader. Needed when building via the ServiceLoader It is a default method as most Config Loaders don't need to apply configs.- Parameters:
config- GestaltConfig to update the ConfigLoader
-
loadSource
GResultOf<java.util.List<ConfigNodeContainer>> loadSource(ConfigSource source) throws GestaltException
Load a ConfigSource then build the validated config node.- Parameters:
source- source we want to load with this config loader.- Returns:
- the validated config node.
- Throws:
GestaltException- any exceptions
-
-