Class Toml
java.lang.Object
org.tomlj.Toml
@DefaultQualifier(value=org.checkerframework.checker.nullness.qual.NonNull.class,
locations={RETURN,PARAMETER,FIELD})
public final class Toml
extends Object
Methods for parsing data stored in Tom's Obvious, Minimal Language (TOML).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcanonicalDottedKey(String dottedKey) Get the canonical form of the dotted key.static booleanPerforms a deep comparison between two arrays to determine if they are equivalent.static booleanPerforms a deep comparison between two tables to determine if they are equivalent.static StringjoinKeyPath(List<String> path) Join a list of keys into a single dotted key string.static TomlParseResultparse(InputStream is) Parse a TOML input stream.static TomlParseResultparse(InputStream is, TomlVersion version) Parse a TOML input stream.static TomlParseResultParse a TOML reader.static TomlParseResultparse(Reader reader, TomlVersion version) Parse a TOML input stream.static TomlParseResultParse a TOML string.static TomlParseResultparse(String input, TomlVersion version) Parse a TOML string.static TomlParseResultparse(ReadableByteChannel channel) Parse a TOML reader.static TomlParseResultparse(ReadableByteChannel channel, TomlVersion version) Parse a TOML input stream.static TomlParseResultParse a TOML file.static TomlParseResultparse(Path file, TomlVersion version) Parse a TOML file.parseDottedKey(String dottedKey) Parse a dotted key into individual parts.static StringBuildertomlEscape(String text) Escape a text string using the TOML escape sequences.
-
Field Details
-
simpleKeyPattern
-
-
Constructor Details
-
Toml
private Toml()
-
-
Method Details
-
parse
Parse a TOML string.- Parameters:
input- The input to parse.- Returns:
- The parse result.
-
parse
Parse a TOML string.- Parameters:
input- The input to parse.version- The version level to parse at.- Returns:
- The parse result.
-
parse
Parse a TOML file.- Parameters:
file- The input file to parse.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parse
Parse a TOML file.- Parameters:
file- The input file to parse.version- The version level to parse at.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parse
Parse a TOML input stream.- Parameters:
is- The UTF-8 encoded input stream to read the TOML document from.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parse
Parse a TOML input stream.- Parameters:
is- The UTF-8 encoded input stream to read the TOML document from.version- The version level to parse at.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parse
Parse a TOML reader.- Parameters:
reader- The reader to obtain the TOML document from.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parse
Parse a TOML input stream.- Parameters:
reader- The reader to obtain the TOML document from.version- The version level to parse at.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parse
Parse a TOML reader.- Parameters:
channel- The channel to read the TOML document from.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parse
public static TomlParseResult parse(ReadableByteChannel channel, TomlVersion version) throws IOException Parse a TOML input stream.- Parameters:
channel- The UTF-8 encoded channel to read the TOML document from.version- The version level to parse at.- Returns:
- The parse result.
- Throws:
IOException- If an IO error occurs.
-
parseDottedKey
Parse a dotted key into individual parts.- Parameters:
dottedKey- A dotted key (e.g.server.address.port).- Returns:
- A list of individual keys in the path.
- Throws:
IllegalArgumentException- If the dotted key cannot be parsed.
-
joinKeyPath
-
canonicalDottedKey
Get the canonical form of the dotted key.- Parameters:
dottedKey- A dotted key (e.g.server.address.port).- Returns:
- The canonical form of the dotted key.
- Throws:
IllegalArgumentException- If the dotted key cannot be parsed.
-
tomlEscape
Escape a text string using the TOML escape sequences.- Parameters:
text- The text string to escape.- Returns:
- A
StringBuilderholding the results of escaping the text.
-
equals
-
equals
-