Package ru.vyarus.yaml.updater.update
Class TreeMerger
- java.lang.Object
-
- ru.vyarus.yaml.updater.update.TreeMerger
-
public final class TreeMerger extends java.lang.ObjectMerges commented models. Rules: - All yaml nodes presented in current config will remain, but comments might be updated (if matching node found in update file). - All new properties copied from update file. - Update file's properties order used (so if in current and update file the same properties would be used, but order changed - update file order would be applied). - Properties padding taken from update file. For example, if in current file properties were shifted with two spaced and in update file with 4 then all properties would be shifted according to update file (even if no new properties applied). Shift appear on subtree level (where subtrees could be matched) so if there are subtrees in old file not present in new one - old paddings will remain there (no target to align by). - Possible whitespace between property name and colon is removed - Property style is taken from new file (e.g. if property name was quoted and in target file not quoted then merged file would contain not quoted property) - Lists are not merged. But if list contain object items, such items are updated (new properties added). Items matched by property values.- Since:
- 11.05.2021
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmerge(CmtTree node, CmtTree from)Merge commented models.
-