Class 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.
    • 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: ConfigReader
        Parse config file into the designated type.
        Specified by:
        parseConfig in class ConfigReader<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.