processNodesOfType

fun <T> Node.processNodesOfType(klass: Class<T>, operation: (T) -> Unit, walker: (Node) -> Sequence<Node> = Node::walk)

Recursively execute operation on this node, and all nodes below this node that extend klass.

T is not forced to be a subtype of Node to support using interfaces.

Parameters

walker

the function that generates the nodes to operate on in the desired sequence.