public class SnakeYamlNodeBuilderImpl extends Object implements SnakeYamlNodeBuilder
SnakeYamlNodeBuilder: creates SnakeYAML nodes for values and comments.| Constructor and Description |
|---|
SnakeYamlNodeBuilderImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected @NotNull List<org.yaml.snakeyaml.comments.CommentLine> |
collectComments(@NotNull Object value,
@NotNull String path,
@NotNull ConfigurationData configurationData,
int numberOfNewLines)
Creates comments based on all possible sources (number of empty lines, configuration data,
ValueWithComments) and returns them as SnakeYAML comment lines. |
protected @NotNull org.yaml.snakeyaml.nodes.Node |
createBooleanNode(boolean value) |
@NotNull Stream<org.yaml.snakeyaml.comments.CommentLine> |
createCommentLines(@NotNull String comment)
Creates SnakeYAML
CommentLine objects to represent the given comment. |
@NotNull org.yaml.snakeyaml.nodes.Node |
createKeyNode(@NotNull String key)
Creates a SnakeYAML string node for a key value (e.g.
|
protected @NotNull org.yaml.snakeyaml.nodes.Node |
createMapNode(@NotNull Map<String,?> value,
String path,
@NotNull ConfigurationData configurationData)
Creates a SnakeYAML node representing a map (collection of key-value pairs).
|
protected @NotNull org.yaml.snakeyaml.nodes.Node |
createNumberNode(@NotNull Number value) |
protected @NotNull org.yaml.snakeyaml.nodes.Node |
createSequenceNode(@NotNull Stream<?> entries,
@NotNull String path,
@NotNull ConfigurationData configurationData)
Creates a SnakeYAML node representing a sequence of the entries in the stream.
|
protected @NotNull org.yaml.snakeyaml.nodes.Node |
createStringNode(@NotNull String value) |
@NotNull org.yaml.snakeyaml.nodes.Node |
createYamlNode(@NotNull Object obj,
@NotNull String path,
@NotNull ConfigurationData configurationData,
int numberOfNewLines)
Creates a SnakeYAML node representing the given value.
|
protected @NotNull Set<UUID> |
getUsedUniqueCommentIds() |
void |
transferComments(@NotNull org.yaml.snakeyaml.nodes.Node valueNode,
@NotNull org.yaml.snakeyaml.nodes.Node keyNode)
Transfers the comments from the value node to the key node.
|
@NotNull
public @NotNull org.yaml.snakeyaml.nodes.Node createYamlNode(@NotNull
@NotNull Object obj,
@NotNull
@NotNull String path,
@NotNull
@NotNull ConfigurationData configurationData,
int numberOfNewLines)
SnakeYamlNodeBuildercreateYamlNode in interface SnakeYamlNodeBuilderobj - the value to create the node for (export value of a property)path - the path of the property whose value is exportedconfigurationData - configuration data (for the retrieval of comments)numberOfNewLines - number of new lines before the property, to add as new lines to the node@NotNull
public @NotNull org.yaml.snakeyaml.nodes.Node createKeyNode(@NotNull
@NotNull String key)
SnakeYamlNodeBuildercreateKeyNode in interface SnakeYamlNodeBuilderkey - the key to wrap into a node@NotNull public @NotNull Stream<org.yaml.snakeyaml.comments.CommentLine> createCommentLines(@NotNull @NotNull String comment)
SnakeYamlNodeBuilderCommentLine objects to represent the given comment. If the comment is equal to the
new line character \n, one comment line representing a blank line is returned. Otherwise, a comment line
is created for each line (the text is split by \n).createCommentLines in interface SnakeYamlNodeBuildercomment - the comment to represent as CommentLinepublic void transferComments(@NotNull
@NotNull org.yaml.snakeyaml.nodes.Node valueNode,
@NotNull
@NotNull org.yaml.snakeyaml.nodes.Node keyNode)
SnakeYamlNodeBuildertransferComments in interface SnakeYamlNodeBuildervalueNode - the value node to remove the comments fromkeyNode - the key node to set the comments to@NotNull
protected @NotNull org.yaml.snakeyaml.nodes.Node createStringNode(@NotNull
@NotNull String value)
@NotNull
protected @NotNull org.yaml.snakeyaml.nodes.Node createNumberNode(@NotNull
@NotNull Number value)
@NotNull protected @NotNull org.yaml.snakeyaml.nodes.Node createBooleanNode(boolean value)
@NotNull
protected @NotNull org.yaml.snakeyaml.nodes.Node createSequenceNode(@NotNull
@NotNull Stream<?> entries,
@NotNull
@NotNull String path,
@NotNull
@NotNull ConfigurationData configurationData)
entries - stream of the entries (from a Java collection or array)path - the property pathconfigurationData - the configuration data (to retrieve comments)@NotNull
protected @NotNull org.yaml.snakeyaml.nodes.Node createMapNode(@NotNull
@NotNull Map<String,?> value,
String path,
@NotNull
@NotNull ConfigurationData configurationData)
value - the map whose values should be in the returned nodepath - the property pathconfigurationData - the configuration data (to retrieve comments)@NotNull protected @NotNull List<org.yaml.snakeyaml.comments.CommentLine> collectComments(@NotNull @NotNull Object value, @NotNull @NotNull String path, @NotNull @NotNull ConfigurationData configurationData, int numberOfNewLines)
ValueWithComments) and returns them as SnakeYAML comment lines.value - the export valuepath - the path the value is located atconfigurationData - the configuration data instancenumberOfNewLines - number of new lines to add to the beginning of the commentsCopyright © 2016–2023 The AuthMe Team. All rights reserved.