Class VisitorUtil


  • public class VisitorUtil
    extends Object
    Author:
    eric.wittmann@gmail.com
    • Constructor Detail

      • VisitorUtil

        public VisitorUtil()
    • Method Detail

      • visitPath

        public static void visitPath​(Node node,
                                     NodePath nodePath,
                                     Visitor visitor)
        Visits nodes along a specific path in the data model tree. Starting from the given node, this method traverses the tree following the path segments defined in the NodePath, visiting each node along the way with the provided visitor. If a node along the path does not exist, traversal stops at the last reachable node.
        Parameters:
        node - The starting node (typically the root document)
        nodePath - The path to traverse through the data model
        visitor - The visitor to apply to each node along the path