SpecEditor class

Generic, typed, meta-validated editing over a SpecDocument.

Constructors

SpecEditor(SpecDocument document, SpecReflection reflection)
Takes an already-built reflection, for the caller that holds one (a query engine, a validator) and would otherwise pay for a second model walk. When only a SpecModel is at hand use SpecEditor.forModel; the two differ in nothing else. Neither checks that document was built against the same model — a mismatch surfaces as ArgumentError on the first path that fails to resolve.
SpecEditor.forModel(SpecDocument document, SpecModel model)
Convenience: builds the editor for document over model.

Properties

document → SpecDocument
The document being edited (the sparse value stores).
final
hashCode → int
The hash code for this object.
no setterinherited
reflection → SpecReflection
The value-free meta-model queries the editor validates against.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListItem(String listPath, {String? sectionId, DateTime? now}) → String
Appends a new item to the list at listPath and returns its stable item path.
clearSection(String path) → void
Clears every value at path and beneath it — content, form entries, nested list items, stored headlines and ids — returning the subtree to the untouched "empty = no value" state (D4). The node itself remains addressable (structure lives in the model, not the document).
formFields(String path) → List<FormFieldSpec>
The form-field specs of the @Form section at path, in declaration order — the meta a generic editor UI renders from.
formValue(String path, String field) → Object?
The typed value of form field at the @Form section path, or null when unset.
headline(String path) → String?
The stored headline at path, or null when the section renders its effective default title.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListItem(String itemPath) → bool
Removes the list item at itemPath with every value beneath it. Returns true when an item was found and removed.
resolve(String path) → SpecResolution
Resolves path against the meta-model, throwing ArgumentError for a dangling path — the strict companion to SpecReflection.resolve.
setFormValue(String path, String field, Object? v) → void
Sets form field at the @Form section path to the typed value v (null clears), converting through the shared boundary helpers.
setHeadline(String path, String? value) → void
Sets the stored headline at path; empty/null returns the section to its default title.
setValue(String path, Object? v) → void
Sets the value leaf at path to v, converting at the store boundary.
toString() → String
A string representation of this object.
inherited
value(String path) → Object?
The typed value at the value leaf path, or null when unset.

Operators

operator ==(Object other) → bool
The equality operator.
inherited