public final class Toml
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
canonicalDottedKey(java.lang.String dottedKey)
Get the canonical form of the dotted key.
|
static java.lang.String |
joinKeyPath(java.util.List<java.lang.String> path)
Join a list of keys into a single dotted key string.
|
static TomlParseResult |
parse(java.io.InputStream is)
Parse a TOML input stream.
|
static TomlParseResult |
parse(java.io.InputStream is,
TomlVersion version)
Parse a TOML input stream.
|
static TomlParseResult |
parse(java.nio.file.Path file)
Parse a TOML file.
|
static TomlParseResult |
parse(java.nio.file.Path file,
TomlVersion version)
Parse a TOML file.
|
static TomlParseResult |
parse(java.nio.channels.ReadableByteChannel channel)
Parse a TOML reader.
|
static TomlParseResult |
parse(java.nio.channels.ReadableByteChannel channel,
TomlVersion version)
Parse a TOML input stream.
|
static TomlParseResult |
parse(java.io.Reader reader)
Parse a TOML reader.
|
static TomlParseResult |
parse(java.io.Reader reader,
TomlVersion version)
Parse a TOML input stream.
|
static TomlParseResult |
parse(java.lang.String input)
Parse a TOML string.
|
static TomlParseResult |
parse(java.lang.String input,
TomlVersion version)
Parse a TOML string.
|
static java.util.List<java.lang.String> |
parseDottedKey(java.lang.String dottedKey)
Parse a dotted key into individual parts.
|
static java.lang.StringBuilder |
tomlEscape(java.lang.String text)
Escape a text string using the TOML escape sequences.
|
public static TomlParseResult parse(java.lang.String input)
input
- The input to parse.public static TomlParseResult parse(java.lang.String input, TomlVersion version)
input
- The input to parse.version
- The version level to parse at.public static TomlParseResult parse(java.nio.file.Path file) throws java.io.IOException
file
- The input file to parse.java.io.IOException
- If an IO error occurs.public static TomlParseResult parse(java.nio.file.Path file, TomlVersion version) throws java.io.IOException
file
- The input file to parse.version
- The version level to parse at.java.io.IOException
- If an IO error occurs.public static TomlParseResult parse(java.io.InputStream is) throws java.io.IOException
is
- The input stream to read the TOML document from.java.io.IOException
- If an IO error occurs.public static TomlParseResult parse(java.io.InputStream is, TomlVersion version) throws java.io.IOException
is
- The input stream to read the TOML document from.version
- The version level to parse at.java.io.IOException
- If an IO error occurs.public static TomlParseResult parse(java.io.Reader reader) throws java.io.IOException
reader
- The reader to obtain the TOML document from.java.io.IOException
- If an IO error occurs.public static TomlParseResult parse(java.io.Reader reader, TomlVersion version) throws java.io.IOException
reader
- The reader to obtain the TOML document from.version
- The version level to parse at.java.io.IOException
- If an IO error occurs.public static TomlParseResult parse(java.nio.channels.ReadableByteChannel channel) throws java.io.IOException
channel
- The channel to read the TOML document from.java.io.IOException
- If an IO error occurs.public static TomlParseResult parse(java.nio.channels.ReadableByteChannel channel, TomlVersion version) throws java.io.IOException
channel
- The channel to read the TOML document from.version
- The version level to parse at.java.io.IOException
- If an IO error occurs.public static java.util.List<java.lang.String> parseDottedKey(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. server.address.port
).java.lang.IllegalArgumentException
- If the dotted key cannot be parsed.public static java.lang.String joinKeyPath(java.util.List<java.lang.String> path)
path
- The list of keys that form the path.public static java.lang.String canonicalDottedKey(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. server.address.port
).java.lang.IllegalArgumentException
- If the dotted key cannot be parsed.public static java.lang.StringBuilder tomlEscape(java.lang.String text)
text
- The text string to escape.StringBuilder
holding the results of escaping the text.