ValidationFeedbackBus

class ValidationFeedbackBus(initial: ValidationResult = ValidationResult())(source)

Holds the editor's latest ValidationResult and fans it out to widget subscribers. One bus per open document — the GUI's editor view-model constructs a bus, calls publish every time it produces a new result, and hands the bus to widgets that decorate themselves from it.

Lives in KSLCore because the routing helpers (issuesAtPath, issuesAtOrBelow) are pure logic; non-Swing consumers (tests, CLI surfaces) can use them too. Widgets in KSLAppSwingCommon subscribe to result and re-render on emission.

Thread-safety is inherited from MutableStateFlow — concurrent publish calls are safe but publish ordering follows the JVM's memory model (the StateFlow itself does not guarantee happens-before across publishers). In practice the editor view-model is the sole publisher.

Constructors

Link copied to clipboard
constructor(initial: ValidationResult = ValidationResult())

Properties

Link copied to clipboard
val result: StateFlow<ValidationResult>

Observable validation state. Read-only; publish via publish.

Functions

Link copied to clipboard

Returns every issue whose path is at or below prefix under the dotted-bracket path tree. Used by per-row aggregators such as RowStatusIcon. Passing an empty prefix returns every issue.

Link copied to clipboard

Returns every issue (ValidationResult.errors + ValidationResult.warnings) whose path exactly matches path. Used by per-field decorators such as FieldErrorMarker.

Link copied to clipboard

Replaces the current validation state with next.