ElementType

class ElementType<E : Element, N : Node>(elementClass: KClass<E>, nodeClass: KClass<out N>, validateLocal: (E) -> Unit, createNode: (E) -> N, updateNode: (E, E, N) -> DirtyMask)(source)

Stable referential token and typed SPI for one element kind.

An application must retain one instance as a singleton for each logical kind.

Two separately constructed tokens remain incompatible even when their class tokens and hooks are otherwise equal.

Parameters

validateLocal

checks properties owned by one description; descendants are validated by the engine.

createNode

creates a detached node for a validated description.

updateNode

applies a previous and current description to a retained node and reports affected phases.

Type Parameters

E

the immutable element description class owned by this token.

N

the retained node class created by this token.

Constructors

Link copied to clipboard
constructor(elementClass: KClass<E>, nodeClass: KClass<out N>, validateLocal: (E) -> Unit, createNode: (E) -> N, updateNode: (E, E, N) -> DirtyMask)

Functions

Link copied to clipboard
fun createErased(element: Element): Node

Creates a node through this token's typed creation hook and verifies the returned class.

Link copied to clipboard
fun updateErased(previous: Element, current: Element, node: Node): DirtyMask

Updates a retained node through this token's typed property-diff hook.

Link copied to clipboard
fun validateErased(element: Element)

Validates one description through this token's typed local-property hook.