Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.45 KB

README.md

File metadata and controls

47 lines (33 loc) · 1.45 KB

TomlJ: A Java parser for Tom's Obvious, Minimal Language (TOML)

TomlJ is a complete TOML parser with the following attributes:

  • Supports the latest TOML specification version (0.5.0).
  • Provides detailed error reporting, including error position.
  • Performs error recovery, allowing parsing to continue after an error.

It uses the ANTLR parser-generator and runtime library.

Usage

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");

Getting TomlJ

TomlJ is published to a Maven and JCenter.

To include using Maven:

<dependency>
  <groupId>org.tomlj</groupId>
  <artifactId>tomlj</artifactId>
  <version>1.0.0</version>
</dependency>

To include using Gradle: compile 'org.tomlj:tomlj:1.0.0'

Snapshot versions are also published to the bintray repository.

Links