Package net.vieiro.toml
Class TOMLParser
- java.lang.Object
-
- net.vieiro.toml.TOMLParser
-
public final class TOMLParser extends Object
Parsers TOML files.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TOMLparseFromFilename(String filename)Parse a TOML document from a file.static TOMLparseFromInputStream(InputStream input)Parse a TOML document from an InputStream.static TOMLparseFromReader(Reader reader)Parse a TOML document from a Reader.static TOMLparseFromReader(Reader reader, String filename)Parse a TOML document from a Reader.static TOMLparseFromString(String content)Parse a TOML document in a String.
-
-
-
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.
-
-