Class TOMLParser


  • public final class TOMLParser
    extends Object
    Parsers TOML files.
    • Method Detail

      • parseFromString

        public static TOML parseFromString​(String content)
                                    throws IOException
        Parse a TOML document in a String.
        Parameters:
        content - The TOML document.
        Returns:
        A TOML object with the result of parsing.
        Throws:
        IOException - If an I/O error happens.
      • parseFromReader

        public static TOML parseFromReader​(Reader reader)
                                    throws IOException
        Parse a TOML document from a Reader.
        Parameters:
        reader - The Reader.
        Returns:
        A TOML object with the result of parsing.
        Throws:
        IOException - If an I/O error happens.
      • parseFromReader

        public static TOML parseFromReader​(Reader reader,
                                           String filename)
                                    throws IOException
        Parse a TOML document from a Reader.
        Parameters:
        reader - The Reader.
        filename - The name of the file, used in error messages.
        Returns:
        A TOML object with the result of parsing.
        Throws:
        IOException - If an I/O error happens.
      • parseFromFilename

        public static TOML parseFromFilename​(String filename)
                                      throws IOException
        Parse a TOML document from a file.
        Parameters:
        filename - The name of the file.
        Returns:
        A TOML object with the result of parsing.
        Throws:
        IOException - If an I/O error happens.
      • parseFromInputStream

        public static TOML parseFromInputStream​(InputStream input)
                                         throws IOException
        Parse a TOML document from an InputStream. Uses UTF-8 as the encoding.
        Parameters:
        input - The InputStream.
        Returns:
        A TOML object with the result of parsing.
        Throws:
        IOException - If an I/O error happens.