Interface ConfigParser<C extends Config>

  • Type Parameters:
    C - the type of config created by the parser

    public interface ConfigParser<C extends Config>
    Interface for reading configurations.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      ConfigFormat<C> getFormat()  
      default void parse​(java.io.File file, Config destination, ParsingMode parsingMode, FileNotFoundAction nefAction)
      Parses a configuration with the UTF-8 charset.
      default void parse​(java.io.File file, Config destination, ParsingMode parsingMode, FileNotFoundAction nefAction, java.nio.charset.Charset charset)
      Parses a configuration.
      default C parse​(java.io.File file, FileNotFoundAction nefAction)
      Parses a configuration with the UTF-8 charset.
      default C parse​(java.io.File file, FileNotFoundAction nefAction, java.nio.charset.Charset charset)
      Parses a configuration.
      default C parse​(java.io.InputStream input)
      Parses a configuration with the UTF-8 charset.
      default void parse​(java.io.InputStream input, Config destination, ParsingMode parsingMode)
      Parses a configuration with the UTF-8 charset.
      default void parse​(java.io.InputStream input, Config destination, ParsingMode parsingMode, java.nio.charset.Charset charset)
      Parses a configuration.
      default C parse​(java.io.InputStream input, java.nio.charset.Charset charset)
      Parses a configuration.
      C parse​(java.io.Reader reader)
      Parses a configuration.
      void parse​(java.io.Reader reader, Config destination, ParsingMode parsingMode)
      Parses a configuration.
      default C parse​(java.lang.String input)
      Parses a configuration String.
      default void parse​(java.lang.String input, Config destination, ParsingMode parsingMode)
      Parses a configuration String.
      default C parse​(java.net.URL url)
      Parses a configuration.
      default void parse​(java.net.URL url, Config destination, ParsingMode parsingMode)
      Parses a configuration.
      default void parse​(java.nio.file.Path file, Config destination, ParsingMode parsingMode, FileNotFoundAction nefAction)
      Parses a configuration with the UTF-8 charset.
      default void parse​(java.nio.file.Path file, Config destination, ParsingMode parsingMode, FileNotFoundAction nefAction, java.nio.charset.Charset charset)
      Parses a configuration.
      default C parse​(java.nio.file.Path file, FileNotFoundAction nefAction)
      Parses a configuration with the UTF-8 charset.
      default C parse​(java.nio.file.Path file, FileNotFoundAction nefAction, java.nio.charset.Charset charset)
      Parses a configuration.
    • Method Detail

      • getFormat

        ConfigFormat<C> getFormat()
        Returns:
        the format supported by this parser
      • parse

        C parse​(java.io.Reader reader)
        Parses a configuration.
        Parameters:
        reader - the reader to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        void parse​(java.io.Reader reader,
                   Config destination,
                   ParsingMode parsingMode)
        Parses a configuration.
        Parameters:
        reader - the reader to parse
        destination - the config where to put the data
      • parse

        default C parse​(java.lang.String input)
        Parses a configuration String.
        Parameters:
        input - the input to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.lang.String input,
                           Config destination,
                           ParsingMode parsingMode)
        Parses a configuration String.
        Parameters:
        input - the input to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs
      • parse

        default C parse​(java.io.InputStream input)
        Parses a configuration with the UTF-8 charset.
        Parameters:
        input - the input to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default C parse​(java.io.InputStream input,
                        java.nio.charset.Charset charset)
        Parses a configuration.
        Parameters:
        input - the input to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.io.InputStream input,
                           Config destination,
                           ParsingMode parsingMode)
        Parses a configuration with the UTF-8 charset.
        Parameters:
        input - the input to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.io.InputStream input,
                           Config destination,
                           ParsingMode parsingMode,
                           java.nio.charset.Charset charset)
        Parses a configuration.
        Parameters:
        input - the input to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs
      • parse

        default C parse​(java.io.File file,
                        FileNotFoundAction nefAction)
        Parses a configuration with the UTF-8 charset.
        Parameters:
        file - the file to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default C parse​(java.io.File file,
                        FileNotFoundAction nefAction,
                        java.nio.charset.Charset charset)
        Parses a configuration.
        Parameters:
        file - the file to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.io.File file,
                           Config destination,
                           ParsingMode parsingMode,
                           FileNotFoundAction nefAction)
        Parses a configuration with the UTF-8 charset.
        Parameters:
        file - the file to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.io.File file,
                           Config destination,
                           ParsingMode parsingMode,
                           FileNotFoundAction nefAction,
                           java.nio.charset.Charset charset)
        Parses a configuration.
        Parameters:
        file - the file to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs
      • parse

        default C parse​(java.nio.file.Path file,
                        FileNotFoundAction nefAction)
        Parses a configuration with the UTF-8 charset.
        Parameters:
        file - the nio Path to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default C parse​(java.nio.file.Path file,
                        FileNotFoundAction nefAction,
                        java.nio.charset.Charset charset)
        Parses a configuration.
        Parameters:
        file - the nio Path to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.nio.file.Path file,
                           Config destination,
                           ParsingMode parsingMode,
                           FileNotFoundAction nefAction)
        Parses a configuration with the UTF-8 charset.
        Parameters:
        file - the nio Path to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.nio.file.Path file,
                           Config destination,
                           ParsingMode parsingMode,
                           FileNotFoundAction nefAction,
                           java.nio.charset.Charset charset)
        Parses a configuration.
        Parameters:
        file - the nio Path to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs
      • parse

        default C parse​(java.net.URL url)
        Parses a configuration.
        Parameters:
        url - the url to parse
        Returns:
        a Config
        Throws:
        ParsingException - if an error occurs
      • parse

        default void parse​(java.net.URL url,
                           Config destination,
                           ParsingMode parsingMode)
        Parses a configuration.
        Parameters:
        url - the url to parse
        destination - the config where to put the data
        Throws:
        ParsingException - if an error occurs