TomlJ is a complete TOML parser with the following attributes:
It uses the ANTLR parser-generator and runtime library.
Parsing is straightforward:
Path source = Paths.get("/path/to/file.toml");
TomlParseResult result = Toml.parse(source);
result.errors().forEach(error -> System.err.println(error.toString()));
String value = result.getString("a. dotted . key");
TomlJ is published to a Maven Central.
To include using Maven:
<dependency>
<groupId>org.tomlj</groupId>
<artifactId>tomlj</artifactId>
<version>1.1.1</version>
</dependency>
To include using Gradle: implementation 'org.tomlj:tomlj:1.1.1'