Module net.morimekta.config
Package net.morimekta.config
Class ConfigReader.YamlConfigReader<ConfigType>
- java.lang.Object
-
- net.morimekta.config.ConfigReader<ConfigType>
-
- net.morimekta.config.ConfigReader.YamlConfigReader<ConfigType>
-
- Type Parameters:
ConfigType- The config type.
- Enclosing class:
- ConfigReader<ConfigType>
public static final class ConfigReader.YamlConfigReader<ConfigType> extends ConfigReader<ConfigType>
Read config as YAML.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.morimekta.config.ConfigReader
ConfigReader.YamlConfigReader<ConfigType>
-
-
Constructor Summary
Constructors Constructor Description YamlConfigReader(Class<ConfigType> configType, Consumer<com.fasterxml.jackson.databind.ObjectMapper> init)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConfigTypeparseConfig(Path file, InputStream stream)Parse config file into the designated type.-
Methods inherited from class net.morimekta.config.ConfigReader
parseConfig, readConfig
-
-
-
-
Constructor Detail
-
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 Detail
-
parseConfig
protected ConfigType parseConfig(Path file, InputStream stream) throws IOException, ConfigException
Description copied from class:ConfigReaderParse config file into the designated type.- Overrides:
parseConfigin classConfigReader<ConfigType>- Parameters:
file- File is parsed. In case this has influence on the parsing.stream- The file input stream to read from.- Returns:
- The parsed config file.
- Throws:
IOException- If reading file failed.ConfigException- If parsing file failed.
-
-