java.lang.Object
org.miaixz.bus.setting.metric.toml.TomlReader
A reader for TOML (Tom's Obvious, Minimal Language) files. This implementation is based on the TOML-javalib project.
Supported date formats:
2021-03-21is parsed as aLocalDate.2021-03-21T19:06:30is parsed as aLocalDateTime.2021-03-21T19:06:30+01:00is parsed as aZonedDateTime.
This class supports a lenient bare key syntax in addition to the standard A-Za-z0-9_- characters.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionTomlReader(String data, boolean strictAsciiBareKeys) Constructs a newTomlReader. -
Method Summary
-
Constructor Details
-
TomlReader
Constructs a newTomlReader.Bare key character rules:
Strict mode (true): [A-Za-z0-9_-] Lenient mode (false): Any character except . [ ] # =
- Parameters:
data- The TOML data as a string.strictAsciiBareKeys- Iftrue, only allows strict bare key format; iffalse, supports a more lenient format.
-
-
Method Details
-
read
Reads and parses the entire TOML data string into a map.- Returns:
- A map representing the parsed TOML data.
-