Module bus.setting

Interface Format

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
DefaultFormatter

public interface Format extends Closeable
An interface for an INI file line formatter. It is responsible for parsing a single line into a corresponding IniElement.
Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Closes the formatter and resets its state by calling init().
    Formats a raw line from an INI file into an IniElement.
    void
    Resets the formatter to its initial state.
  • Method Details

    • formatLine

      IniElement formatLine(String line)
      Formats a raw line from an INI file into an IniElement.
      Parameters:
      line - The line string to format.
      Returns:
      The parsed IniElement, or null if the line should be ignored (e.g., an empty line).
    • init

      void init()
      Resets the formatter to its initial state. This is useful when reusing the formatter to parse a new file.
    • close

      default void close()
      Closes the formatter and resets its state by calling init().
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable