Skip to content
/ xtomlj Public

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

License

Notifications You must be signed in to change notification settings

A248/xtomlj

Repository files navigation

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

xTomlJ is a complete TOML parser with the following attributes:

  • Supports the latest TOML specification version (1.0.0-rc.1).
  • 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.

This is a fork from the original project TomlJ. It was created because the original project appears to be inactive.

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 xTomlJ

xTomlJ is published to Maven Central.

To include using Maven:

<dependency>
  <groupId>io.github.xtomlj</groupId>
  <artifactId>xtomlj</artifactId>
  <version>1.1.0</version>
</dependency>

To include using Gradle: implementation 'io.github.xtomlj:xtomlj:1.1.0'

Links

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published