Package org.tomlj

Enum Class TomlWriteOptions.Keep

java.lang.Object
java.lang.Enum<TomlWriteOptions.Keep>
org.tomlj.TomlWriteOptions.Keep
All Implemented Interfaces:
Serializable, Comparable<TomlWriteOptions.Keep>, Constable
Enclosing class:
TomlWriteOptions

public static enum TomlWriteOptions.Keep extends Enum<TomlWriteOptions.Keep>
How much of the existing document structure and format is kept.

Each value keeps less than the one before it, and where a value has nothing to keep, the next value applies. Where an amount is set on a single table or array through MutableTomlTable.reformat(Keep) as well as in the options, the table or array keeps the later of the two in this order.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Keep the layout of a parsed document: every line, header and comment the parser accepted is written back as it was read, with its spacing, indentation and blank lines, and only what the editing API changed is written anew.
    Keep the notation of a parsed document: the form each key, value and table was written in, whether 0x10 or 16, a bare or quoted key, a basic or literal string, a header, dotted keys or an inline table.
    Keep nothing: everything is written in the default style.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LAYOUT

      public static final TomlWriteOptions.Keep LAYOUT
      Keep the layout of a parsed document: every line, header and comment the parser accepted is written back as it was read, with its spacing, indentation and blank lines, and only what the editing API changed is written anew.

      Anything with no layout to keep - a line written anew, a table built with the editing API, a document parsed with TomlParseOptions.withoutSource(), a table of a parse result rather than the result itself - is written as NOTATION writes it.

    • NOTATION

      public static final TomlWriteOptions.Keep NOTATION
      Keep the notation of a parsed document: the form each key, value and table was written in, whether 0x10 or 16, a bare or quoted key, a basic or literal string, a header, dotted keys or an inline table. The order of its lines and sections and its comments are kept too, while whitespace, indentation, blank lines and the layout of arrays and inline tables come from the options.

      Anything with no notation to keep, such as a document parsed without its source, is written as NOTHING writes it.

    • NOTHING

      public static final TomlWriteOptions.Keep NOTHING
      Keep nothing: everything is written in the default style.
  • Method Details

    • values

      public static TomlWriteOptions.Keep[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TomlWriteOptions.Keep valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null