Module bus.setting

Class AbstractFormatter<E extends IniElement>

java.lang.Object
org.miaixz.bus.setting.format.AbstractFormatter<E>
Type Parameters:
E - The type of IniElement this formatter produces.
All Implemented Interfaces:
ElementFormatter<E>
Direct Known Subclasses:
CommentFormatter, PropertyFormatter, SectionFormatter

public abstract class AbstractFormatter<E extends IniElement> extends Object implements ElementFormatter<E>
An abstract base class for formatters that convert string values into IniElement objects. All concrete formatters, except for the CommentFormatter itself, typically require a CommentFormatter to handle inline or trailing comments.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • AbstractFormatter

      public AbstractFormatter(CommentFormatter commentElementFormatter)
      Constructs an AbstractFormatter with a specific comment formatter.
      Parameters:
      commentElementFormatter - The formatter for parsing comments.
    • AbstractFormatter

      public AbstractFormatter()
      Constructs an AbstractFormatter with a default comment formatter.
  • Method Details

    • getCommentElementFormatter

      protected CommentFormatter getCommentElementFormatter()
      Gets the current comment element formatter.
      Returns:
      The CommentFormatter.
    • setCommentElementFormatter

      protected void setCommentElementFormatter(CommentFormatter commentElementFormatter)
      Sets the comment element formatter.
      Parameters:
      commentElementFormatter - The new CommentFormatter.