Class IndentationPolicy

java.lang.Object
io.github.wasabithumb.jtoml.option.prop.IndentationPolicy

public final class IndentationPolicy extends Object
Determines how a TOML document should be indented when writing.

Rules

  • indentChar() defines the character used to perform indentation, either SPACE or TAB.
  • globalIndent() defines the initial indentation for each line.
  • The indentation level is set to globalIndent() plus constantIndent() directly before each table declaration, as well as an additional variableIndent() for each additional part in the table path. For instance, the declaration [a.b.c] would set the indent level to globalIndent + constantIndent + 2 * variableIndent.
  • The indentation level is incremented by postIndent() directly after each table declaration.
  • Field Details

    • NONE

      public static final IndentationPolicy NONE
      No indentation
    • STANDARD

      public static final IndentationPolicy STANDARD
      indentationLevel is initialized to 0. Table headers set indentationLevel to key.size() - 1. Each line is preceded by "indentationLevel" TAB characters.
  • Method Details

    • builder

      @Contract("-> new") @NotNull public static @NotNull IndentationPolicy.Builder builder()
    • indentChar

      public char indentChar()
    • globalIndent

      public @org.jetbrains.annotations.Range(from=0L, to=255L) int globalIndent()
    • constantIndent

      public @org.jetbrains.annotations.Range(from=0L, to=255L) int constantIndent()
    • variableIndent

      public @org.jetbrains.annotations.Range(from=0L, to=255L) int variableIndent()
    • postIndent

      public @org.jetbrains.annotations.Range(from=0L, to=255L) int postIndent()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object