SingleItemTransformationRule

data class SingleItemTransformationRule(from: Name, transform: MutableMeta.(Name, Meta?) -> Unit) : TransformationRule

A transformation which transforms element with specific name

Constructors

SingleItemTransformationRule
Link copied to clipboard
common
fun SingleItemTransformationRule(from: Name, transform: MutableMeta.(Name, Meta?) -> Unit)

Functions

matches
Link copied to clipboard
common
open override fun matches(name: Name, item: Meta?): Boolean

Check if this transformation should be applied to a node with given name and value

selectItems
Link copied to clipboard
common
open override fun selectItems(meta: Meta): Sequence<Name>

Select all items to be transformed. Item could be a value as well as node

transformItem
Link copied to clipboard
common
open override fun transformItem(name: Name, item: Meta?, target: MutableMeta)

Apply transformation for a single item (Node or Value) to the target

Properties

from
Link copied to clipboard
common
val from: Name
transform
Link copied to clipboard
common
val transform: MutableMeta.(Name, Meta?) -> Unit