- java.lang.Object
-
- org.github.gestalt.config.loader.MapConfigLoader
-
- All Implemented Interfaces:
ConfigLoader
public final class MapConfigLoader extends java.lang.Object implements ConfigLoader
Loads an in memory map from MapConfigSource.
-
-
Constructor Summary
Constructors Constructor Description MapConfigLoader()Construct a default Map Config loader using the default path lexer for "." separated paths.MapConfigLoader(SentenceLexer lexer, ConfigParser parser)Construct a Map Config loader providing a lexer and a config parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(java.lang.String format)True if the config loader accepts the format.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.github.gestalt.config.loader.ConfigLoader
applyConfig
-
-
-
-
Constructor Detail
-
MapConfigLoader
public MapConfigLoader()
Construct a default Map Config loader using the default path lexer for "." separated paths.
-
MapConfigLoader
public MapConfigLoader(SentenceLexer lexer, ConfigParser parser)
Construct a Map Config loader providing a lexer and a config parser.- Parameters:
lexer- SentenceLexer to create tokens for the path.parser- Parser for the Map Config files
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:ConfigLoaderName of the config loader.- Specified by:
namein interfaceConfigLoader- Returns:
- name
-
accepts
public boolean accepts(java.lang.String format)
Description copied from interface:ConfigLoaderTrue if the config loader accepts the format.- Specified by:
acceptsin interfaceConfigLoader- Parameters:
format- config format.- Returns:
- True if the config loader accepts the format.
-
loadSource
public GResultOf<java.util.List<ConfigNodeContainer>> loadSource(ConfigSource source) throws GestaltException
Description copied from interface:ConfigLoaderLoad a ConfigSource then build the validated config node.- Specified by:
loadSourcein interfaceConfigLoader- Parameters:
source- source we want to load with this config loader.- Returns:
- the validated config node.
- Throws:
GestaltException- any exceptions
-
-