Class OperatorFileWriter.EmptySections
java.lang.Object
com.ultikits.ultitools.config.document.OperatorFileWriter.EmptySections
- Enclosing class:
OperatorFileWriter
The sections an insert finds empty (#620, #610 item 2). For every value path the edit inserts, the nearest key
above it that the file already holds is its section. When the write does not own that section and the file holds
it with no value:
- left with no value - a block key followed on its line by the colon and nothing else, a comment
allowed (
messages:,messages: # note), the shape deleting every child leaves - the section is expanded: the write owns that one line, its value may become a mapping holding only the inserted keys, andOperatorFileWriter.markExpandedSection(com.ultikits.ultitools.config.document.OperatorFileWriter.Side, com.ultikits.ultitools.config.document.OperatorFileWriter.Side, java.util.List<java.lang.String>, boolean, boolean)keeps the operator's key text, comment and line terminator on it (owned-span rule revision 3, maintainer decision 2026-10-06: deleting every child is most likely accidental, so the framework keeps the section complete); - written as an explicit empty value -
~,null,!!nullor{}on a block key - the operator's own value, never reinterpreted as "left empty": the write is refused before rendering (it was refused before as well, by the checks below, with reasons that did not say what to change) with a reason that names the section and its line, never its value, and says what the operator can change.
? key, a scalar - is not owned and is
left to the existing checks, which refuse a change to it.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternThe rest of a section line after its key, terminator removed, when the key was left with no value.(package private) static final OperatorFileWriter.EmptySectionsprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanendsAfterColon(org.yaml.snakeyaml.nodes.NodeTuple tuple, List<String> lines, boolean byteOrderMark) Whether the section key's line holds nothing after the colon but spaces and, optionally, a comment.nearestHeldAncestor(ConfigDocument original, List<String> path) (package private) static OperatorFileWriter.EmptySectionsof(String text, ConfigDocument original, ConfigDocument candidate, OperatorFileWriter.Changes changes) private static booleanonBlockKeyLine(org.yaml.snakeyaml.nodes.NodeTuple tuple, List<String> lines, boolean byteOrderMark) A single-line key starting its line (only indentation, or the byte-order mark, before it).private static booleanWhether a value path the write changes is the section itself or a key above it (its line is owned anyway).
-
Field Details
-
NONE
-
NO_VALUE
The rest of a section line after its key, terminator removed, when the key was left with no value. -
expanded
-
refusal
-
-
Constructor Details
-
EmptySections
private EmptySections()
-
-
Method Details
-
of
static OperatorFileWriter.EmptySections of(String text, ConfigDocument original, ConfigDocument candidate, OperatorFileWriter.Changes changes) -
nearestHeldAncestor
-
ownedAbove
Whether a value path the write changes is the section itself or a key above it (its line is owned anyway). -
onBlockKeyLine
private static boolean onBlockKeyLine(org.yaml.snakeyaml.nodes.NodeTuple tuple, List<String> lines, boolean byteOrderMark) A single-line key starting its line (only indentation, or the byte-order mark, before it). -
endsAfterColon
private static boolean endsAfterColon(org.yaml.snakeyaml.nodes.NodeTuple tuple, List<String> lines, boolean byteOrderMark) Whether the section key's line holds nothing after the colon but spaces and, optionally, a comment.
-