Package org.tomlj

Interface TomlParseResult

All Superinterfaces:
MutableTomlTable, TomlTable

public interface TomlParseResult extends MutableTomlTable
The result from parsing a TOML document.

Parsing never throws for invalid input. Instead, every error is recorded in errors() and parsing continues with the next expression, so a document with errors still yields the values that could be parsed. Callers should check hasErrors() before relying on the result. A key/value pair containing a syntax error is omitted from the result.

A parse result is a MutableTomlTable, so a parsed document can be changed and written back out with TomlTable.toToml(), written back from the text it was parsed from; see TomlWriteOptions. errors() reports only what was found while parsing, and is unaffected by any change made afterwards.

  • Method Details

    • hasErrors

      default boolean hasErrors()
      true if the TOML document contained errors.
      Returns:
      true if the TOML document contained errors.
    • errors

      List<TomlParseError> errors()
      The errors that occurred during parsing.
      Returns:
      A list of errors.