Package org.sonar.php.tree
Class TreeUtils
- java.lang.Object
-
- org.sonar.php.tree.TreeUtils
-
public class TreeUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stream<Tree>
descendants(Tree root)
static <T extends Tree>
Stream<T>descendants(Tree root, Class<T> clazz)
static Tree
findAncestorWithKind(Tree tree, Collection<Tree.Kind> kinds)
static <T extends Tree>
Optional<T>firstDescendant(Tree root, Class<T> clazz)
static Optional<Tree>
firstDescendant(Tree root, Predicate<Tree> predicate)
static boolean
isDescendant(Tree tree, Tree potentialParent)
-
-
-
Method Detail
-
findAncestorWithKind
@CheckForNull public static Tree findAncestorWithKind(Tree tree, Collection<Tree.Kind> kinds)
-
descendants
public static <T extends Tree> Stream<T> descendants(@Nullable Tree root, Class<T> clazz)
-
firstDescendant
public static Optional<Tree> firstDescendant(@Nullable Tree root, Predicate<Tree> predicate)
-
-