YamlUpdateStrategy

class YamlUpdateStrategy : UpdateStrategy

Default UpdateStrategy implementation for YAML configuration files.

This strategy updates an existing YAML configuration file by merging it with the default configuration resource, preserving user-defined values while adding new keys or updating missing entries.

It uses org.snakeyaml.engine.v2 to parse and manipulate the YAML AST, allowing structural merging while keeping comments intact at the root level.

Typically used internally by the YAML parser module.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun updateIfNeeded(context: UpdateContext): Boolean

Checks if the config file needs updating by comparing versions, merges missing or updated keys preserving user data, and writes the updated YAML back to the file.