java.lang.Object
net.morimekta.config.readers.YamlConfigReader<ConfigType>
- Type Parameters:
ConfigType- The config type.
- All Implemented Interfaces:
ConfigReader<ConfigType>
Read config as YAML.
-
Constructor Summary
ConstructorsConstructorDescriptionYamlConfigReader(Class<ConfigType> configType) YamlConfigReader(Class<ConfigType> configType, Consumer<com.fasterxml.jackson.databind.ObjectMapper> init) -
Method Summary
-
Constructor Details
-
YamlConfigReader
- Parameters:
configType- The config type class.
-
YamlConfigReader
public YamlConfigReader(Class<ConfigType> configType, Consumer<com.fasterxml.jackson.databind.ObjectMapper> init) - Parameters:
configType- The config type class.init- A consumer callback to initialize the object mapper. E.g. if extra modules needs to be loaded.
-
-
Method Details
-
readConfig
- Specified by:
readConfigin interfaceConfigReader<ConfigType>- Parameters:
file- File path to load config from.- Returns:
- The loaded config file.
- Throws:
IOException- If reading the config file failed.ConfigException- If parsing file failed.
-