Function

traverseDescendants

Conditionally executes [block] for each descendant with a matching [key].

traverseDescendants

Common
fun DelegatableNode.traverseDescendants(
    key: Any?,
    block: (TraversableNode) -> TraverseDescendantsAction,
)

Conditionally executes block for each descendant with a matching key.

Note 1: For nodes that do not have the same key, it will continue to execute the block for descendants below that non-matching node (where there may be a node that matches).

Note 2: The parameter block's return value TraverseDescendantsAction will determine the next step in the traversal.


traverseDescendants

Common
fun <T> T.traverseDescendants(block: (T) -> TraverseDescendantsAction) where T : TraversableNode

Conditionally executes block for each descendant of the same class.

Note 1: For nodes that do not have the same key, it will continue to execute the block for the descendants below that non-matching node (where there may be a node that matches).

Note 2: The parameter block's return value TraverseDescendantsAction will determine the next step in the traversal.