public class YamlCommentFormatter extends Object implements org.simpleyaml.configuration.comments.format.CommentFormatter
Default format is YamlCommentFormat.DEFAULT.
| Modifier and Type | Field and Description |
|---|---|
protected YamlCommentFormatterConfiguration |
blockFormatter |
protected YamlSideCommentFormatterConfiguration |
sideFormatter |
| Constructor and Description |
|---|
YamlCommentFormatter() |
YamlCommentFormatter(YamlCommentFormatterConfiguration blockFormatter) |
YamlCommentFormatter(YamlCommentFormatterConfiguration blockFormatter,
YamlSideCommentFormatterConfiguration sideFormatter) |
| Modifier and Type | Method and Description |
|---|---|
YamlCommentFormatterConfiguration |
blockFormatter() |
String |
dump(String comment,
org.simpleyaml.configuration.comments.CommentType type,
org.simpleyaml.configuration.comments.KeyTree.Node node) |
boolean |
equals(Object o) |
YamlCommentFormatterConfiguration |
formatterConfiguration(org.simpleyaml.configuration.comments.CommentType type) |
int |
hashCode() |
String |
parse(Reader raw,
org.simpleyaml.configuration.comments.CommentType type,
org.simpleyaml.configuration.comments.KeyTree.Node node) |
protected String |
parseCommentLine(String line,
String prefix,
boolean strip) |
YamlSideCommentFormatterConfiguration |
sideFormatter() |
YamlCommentFormatter |
stripPrefix(boolean strip)
Set if stripping the prefix is desired.
|
String |
toString() |
YamlCommentFormatter |
trim(boolean trim)
Set if leading and trailing spaces and blank lines at the beginning and end of the comments should be stripped away.
|
protected final YamlCommentFormatterConfiguration blockFormatter
protected final YamlSideCommentFormatterConfiguration sideFormatter
public YamlCommentFormatter(YamlCommentFormatterConfiguration blockFormatter, YamlSideCommentFormatterConfiguration sideFormatter)
public YamlCommentFormatter(YamlCommentFormatterConfiguration blockFormatter)
public YamlCommentFormatter()
public String parse(Reader raw, org.simpleyaml.configuration.comments.CommentType type, org.simpleyaml.configuration.comments.KeyTree.Node node) throws IOException
parse in interface org.simpleyaml.configuration.comments.format.CommentFormatterIOExceptionpublic String dump(String comment, org.simpleyaml.configuration.comments.CommentType type, org.simpleyaml.configuration.comments.KeyTree.Node node)
dump in interface org.simpleyaml.configuration.comments.format.CommentFormatterpublic final YamlCommentFormatterConfiguration blockFormatter()
public final YamlSideCommentFormatterConfiguration sideFormatter()
public final YamlCommentFormatterConfiguration formatterConfiguration(org.simpleyaml.configuration.comments.CommentType type)
public YamlCommentFormatter stripPrefix(boolean strip)
If strip is true then the comment prefix will be stripped away.
Default is true.
strip - if stripping the prefix is desiredpublic YamlCommentFormatter trim(boolean trim)
This does not affect to every line of a multiline comment. Only to the beginning and end of the whole comment.
Default is true.
trim - if String.trim() should be applied to commentsCopyright © 2023. All rights reserved.