Skip to content
/ tomlj Public
forked from tomlj/tomlj

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

License

Notifications You must be signed in to change notification settings

zhanglei/tomlj

 
 

Repository files navigation

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 (1.0.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 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'

Links

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 95.6%
  • ANTLR 4.4%