Module bus.setting
Package org.miaixz.bus.setting.format
Class AbstractFormatter<E extends IniElement>
java.lang.Object
org.miaixz.bus.setting.format.AbstractFormatter<E>
- Type Parameters:
E- The type ofIniElementthis 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 Summary
ConstructorsConstructorDescriptionConstructs an AbstractFormatter with a default comment formatter.AbstractFormatter(CommentFormatter commentElementFormatter) Constructs an AbstractFormatter with a specific comment formatter. -
Method Summary
Modifier and TypeMethodDescriptionprotected CommentFormatterGets the current comment element formatter.protected voidsetCommentElementFormatter(CommentFormatter commentElementFormatter) Sets the comment element formatter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.setting.format.ElementFormatter
check, format
-
Constructor Details
-
AbstractFormatter
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
Gets the current comment element formatter.- Returns:
- The
CommentFormatter.
-
setCommentElementFormatter
Sets the comment element formatter.- Parameters:
commentElementFormatter- The newCommentFormatter.
-