Package org.yaml.snakeyaml.util
Class MergeUtils
- java.lang.Object
-
- org.yaml.snakeyaml.util.MergeUtils
-
public abstract class MergeUtils extends Object
Utility to process merge keys (https://yaml.org/type/merge.html) of the MappingNode
-
-
Constructor Summary
Constructors Constructor Description MergeUtils()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract MappingNodeasMappingNode(Node node)Converts the specifiednodeinto aMappingNode.List<NodeTuple>flatten(MappingNode node)Processes and resolves merge keys in aMappingNode, merging resolved key/values into the node.
-
-
-
Method Detail
-
asMappingNode
public abstract MappingNode asMappingNode(Node node)
Converts the specifiednodeinto aMappingNode.This method is designed to transform various types of
Nodeinto aMappingNode, enabling further processing such as merging of keys.- Parameters:
node- The node to be transformed.- Returns:
- A
MappingNoderepresentation of the inputnode.
-
flatten
public List<NodeTuple> flatten(MappingNode node)
Processes and resolves merge keys in aMappingNode, merging resolved key/values into the node.Implements the YAML merge key feature by examining the nodes within the provided
nodeand merging keys from referenced by "merge key" map(s) into the current mapping as per the YAML specification. Handling of duplicate keys is defined by the order of appearance in the mapping node, with priority given to the keys defined innodeand the the earliest occurrences in the merging ones.- Parameters:
node- The MappingNode to process for merge keys.- Returns:
- A list of
NodeTuplecontaining the merged keys and values. - See Also:
- YAML Merge Key Specification
-
-