Resolver

class Resolver(val directives: DirectiveRegistry = DirectiveRegistry.Default)

Turns a dynamic view template — a JoyDOM Spec containing $-marked directives — into a static document the renderer draws unchanged.

resolve is a pure function: same (view, state) always produces the same output or the same ResolveException — no I/O, no writes, never a partial tree. The authored state and defs regions are consumed, never emitted; the runtime JsonObject state argument is the authoritative data source.

Constructors

Link copied to clipboard
constructor(directives: DirectiveRegistry = DirectiveRegistry.Default)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun resolve(view: <Error class: unknown class>, state: <Error class: unknown class> = JsonObject(emptyMap())): <Error class: unknown class>

Resolves view against state into a static document. Throws ResolveException.

fun resolve(viewJson: String, stateJson: String = "{}"): <Error class: unknown class>

Parsing convenience over resolve.

Link copied to clipboard
fun resolveSpec(view: <Error class: unknown class>, state: <Error class: unknown class> = JsonObject(emptyMap())): <Error class: unknown class>

resolve, decoded into the typed Spec model.

Link copied to clipboard
fun resolveValue(template: <Error class: unknown class>, state: <Error class: unknown class> = JsonObject(emptyMap()), defs: <Error class: unknown class> = JsonObject(emptyMap())): <Error class: unknown class>

Resolves a single template in value position against state and defs — no document, no layout, no node splicing. The applier evaluates handler value slots through this: each call gets a fresh, lazy defs frame, so a caller that re-reads between writes sees defs re-derived against the new state.

Link copied to clipboard
fun validate(view: <Error class: unknown class>): List<ValidationIssue>

Creation-time checks for authoring tools: duplicate names across the flat namespace and reserved names. Returns issues, never throws; resolve does not run these — runtime name collisions are settled by precedence.