Module net.morimekta.tiny.server
Package net.morimekta.tiny.server.config
Class ConfigReader.YamlConfigReader<ConfigType>
- java.lang.Object
-
- net.morimekta.tiny.server.config.ConfigReader<ConfigType>
-
- net.morimekta.tiny.server.config.ConfigReader.YamlConfigReader<ConfigType>
-
- Type Parameters:
ConfigType- The config type.
- Enclosing class:
- ConfigReader<ConfigType>
public static class ConfigReader.YamlConfigReader<ConfigType> extends ConfigReader<ConfigType>
Read config as YAML.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.morimekta.tiny.server.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(String fileName, InputStream stream)Parse config file into the designated type.-
Methods inherited from class net.morimekta.tiny.server.config.ConfigReader
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(String fileName, InputStream stream) throws IOException
Description copied from class:ConfigReaderParse config file into the designated type.- Specified by:
parseConfigin classConfigReader<ConfigType>- Parameters:
fileName- File name that 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 parsing failed.
-
-