java.lang.Object
org.miaixz.bus.setting.format.AbstractFormatter<IniComment>
org.miaixz.bus.setting.format.CommentFormatter
- All Implemented Interfaces:
ElementFormatter<IniComment>
A formatter that parses a string value into an
IniComment object.- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a CommentFormatter with the default starting character ('#').CommentFormatter(char startChar) Constructs a CommentFormatter with a specific starting character. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the given string value is a comment.Formats a comment string into anIniCommentobject.Methods inherited from class org.miaixz.bus.setting.format.AbstractFormatter
getCommentElementFormatter, setCommentElementFormatter
-
Constructor Details
-
CommentFormatter
public CommentFormatter(char startChar) Constructs a CommentFormatter with a specific starting character.- Parameters:
startChar- The character that identifies a comment line.
-
CommentFormatter
public CommentFormatter()Constructs a CommentFormatter with the default starting character ('#').
-
-
Method Details
-
format
Formats a comment string into anIniCommentobject.- Parameters:
value- The raw string line, including the starting comment character.line- The line number in the original file.- Returns:
- The parsed
IniCommentobject.
-
check
Checks if the given string value is a comment.- Parameters:
value- The string to check.- Returns:
trueif the string starts with the configured comment character.
-