Class AstTraversalUtil
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.AstTraversalUtil
-
public final class AstTraversalUtil extends java.lang.Object
- Author:
- Clément Fournier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<net.sourceforge.pmd.lang.ast.Node>
findOldNodeInNewAst(net.sourceforge.pmd.lang.ast.Node oldSelection, net.sourceforge.pmd.lang.ast.Node newRoot)
static net.sourceforge.pmd.lang.ast.Node
getRoot(net.sourceforge.pmd.lang.ast.Node n)
static boolean
isParent(net.sourceforge.pmd.lang.ast.Node parent, net.sourceforge.pmd.lang.ast.Node child)
static java.util.Optional<net.sourceforge.pmd.lang.ast.Node>
mapToMyTree(net.sourceforge.pmd.lang.ast.Node myRoot, net.sourceforge.pmd.lang.ast.Node node, PmdCoordinatesSystem.TextPos2D caretPositionOrNull)
Tries hard to find the node in [myRoot] that corresponds most closely to the given [node], which may be from another tree.static <T> java.util.Iterator<javafx.scene.control.TreeItem<T>>
parentIterator(javafx.scene.control.TreeItem<T> deepest, boolean includeSelf)
Returns an iterator over the parents of the given node, in innermost to outermost order.static java.util.Iterator<net.sourceforge.pmd.lang.ast.Node>
parentIterator(net.sourceforge.pmd.lang.ast.Node deepest, boolean includeSelf)
Returns an iterator over the parents of the given node, in innermost to outermost order.
-
-
-
Method Detail
-
getRoot
public static net.sourceforge.pmd.lang.ast.Node getRoot(net.sourceforge.pmd.lang.ast.Node n)
-
mapToMyTree
public static java.util.Optional<net.sourceforge.pmd.lang.ast.Node> mapToMyTree(net.sourceforge.pmd.lang.ast.Node myRoot, net.sourceforge.pmd.lang.ast.Node node, PmdCoordinatesSystem.TextPos2D caretPositionOrNull)
Tries hard to find the node in [myRoot] that corresponds most closely to the given [node], which may be from another tree.- Parameters:
myRoot
- (Nullable) root of the tree in which to searchnode
- (Nullable) node to look for
-
findOldNodeInNewAst
public static java.util.Optional<net.sourceforge.pmd.lang.ast.Node> findOldNodeInNewAst(net.sourceforge.pmd.lang.ast.Node oldSelection, net.sourceforge.pmd.lang.ast.Node newRoot)
- Parameters:
oldSelection
- Not nullnewRoot
- Not null
-
parentIterator
public static java.util.Iterator<net.sourceforge.pmd.lang.ast.Node> parentIterator(net.sourceforge.pmd.lang.ast.Node deepest, boolean includeSelf)
Returns an iterator over the parents of the given node, in innermost to outermost order.
-
parentIterator
public static <T> java.util.Iterator<javafx.scene.control.TreeItem<T>> parentIterator(javafx.scene.control.TreeItem<T> deepest, boolean includeSelf)
Returns an iterator over the parents of the given node, in innermost to outermost order.
-
isParent
public static boolean isParent(net.sourceforge.pmd.lang.ast.Node parent, net.sourceforge.pmd.lang.ast.Node child)
-
-