public enum YamlCommentFormat extends Enum<YamlCommentFormat>
Modifier and Type | Class and Description |
---|---|
static interface |
YamlCommentFormat.YamlCommentFormatterFactory |
Enum Constant and Description |
---|
BLANK_LINE
BLANK_LINE comment format gets comments in a readable way stripping the # comment prefix and without indentation,
but it keeps trailing spaces and blank lines.
|
DEFAULT
DEFAULT comment format gets comments in a readable way stripping the # comment prefix,
without leading and trailing spaces or blank lines and without indentation.
|
PRETTY
PRETTY comment format gets comments in a readable way stripping the # comment prefix,
without leading and trailing spaces or blank lines and without indentation.
|
RAW
RAW comment format gets comments as they are in the file configuration,
with blank lines and the comment prefix with # character,
but without the indentation prefix.
|
Modifier and Type | Method and Description |
---|---|
YamlCommentFormatter |
commentFormatter() |
static void |
reset() |
static YamlCommentFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static YamlCommentFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final YamlCommentFormat DEFAULT
- BLOCK comments: "# ", i.e. a # followed by a space.
- SIDE comments: " # ", i.e. a space followed by # with a space.
If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.public static final YamlCommentFormat PRETTY
- BLOCK comments with 0 indentation (root keys) except first key: "\n# ", i.e. a blank line followed by # with a space. Multiline comments do not add additional blank lines.
- BLOCK comments with some indentation (child keys) or first key: "# ", i.e. a # followed by a space.
- SIDE comments: " # ", i.e. a space followed by # with a space.
If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.public static final YamlCommentFormat BLANK_LINE
- BLOCK comments: "\n# ", i.e. a blank line followed by # with a space. Multiline comments do not add additional blank lines.
- SIDE comments: "\n# ", i.e. a new line followed by # with a space. This will add the comment below.
If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.public static final YamlCommentFormat RAW
- BLOCK comments: "# ", i.e. a # followed by a space.
- SIDE comments: " # ", i.e. a space followed by # with a space.
If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.public static YamlCommentFormat[] values()
for (YamlCommentFormat c : YamlCommentFormat.values()) System.out.println(c);
public static YamlCommentFormat valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic YamlCommentFormatter commentFormatter()
public static void reset()
Copyright © 2023. All rights reserved.