https://github.com/tomlj/tomlj
A Java parser for Tom's Obvious, Minimal Language (TOML).
https://github.com/tomlj/tomlj
config configuration java toml
Last synced: 13 days ago
JSON representation
A Java parser for Tom's Obvious, Minimal Language (TOML).
- Host: GitHub
- URL: https://github.com/tomlj/tomlj
- Owner: tomlj
- License: apache-2.0
- Created: 2019-05-07T21:40:04.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T17:55:55.000Z (about 2 years ago)
- Last Synced: 2024-01-31T03:02:28.008Z (almost 2 years ago)
- Topics: config, configuration, java, toml
- Language: Java
- Homepage:
- Size: 655 KB
- Stars: 126
- Watchers: 3
- Forks: 26
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# TomlJ: A Java parser for Tom's Obvious, Minimal Language (TOML)
TomlJ is a complete [TOML](https://github.com/toml-lang/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](https://github.com/antlr/antlr4/) parser-generator and
runtime library.
## Usage
Parsing is straightforward:
```java
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:
```xml
org.tomlj
tomlj
1.1.1
```
To include using Gradle: `implementation 'org.tomlj:tomlj:1.1.1'`
## Links
- [GitHub project](https://github.com/tomlj/tomlj)
- [Online Java documentation](https://tomlj.org/docs/java/latest/org/tomlj/package-summary.html)
- [Issue tracker: Report a defect or feature request](https://github.com/tomlj/tomlj/issues/new)
- [StackOverflow: Ask "how-to" and "why-didn't-it-work" questions](https://stackoverflow.com/questions/ask?tags=tomlj)