public final class Navigator extends Object
public static ClassOrInterfaceDeclaration demandClass(CompilationUnit cu, String qualifiedName)
public static ClassOrInterfaceDeclaration demandClassOrInterface(CompilationUnit compilationUnit, String qualifiedName)
public static ConstructorDeclaration demandConstructor(TypeDeclaration<?> td, int index)
(i+1)
'th constructor of the given type declaration, in textual order. The constructor that
appears first has the index 0, the second one the index 1, and so on.td
- The type declaration to search in. Note that only classes and enums have constructors.index
- The index of the desired constructor.public static EnumDeclaration demandEnum(CompilationUnit cu, String qualifiedName)
public static VariableDeclarator demandField(ClassOrInterfaceDeclaration cd, String name)
public static ClassOrInterfaceDeclaration demandInterface(CompilationUnit cu, String qualifiedName)
public static MethodDeclaration demandMethod(TypeDeclaration<?> cd, String name)
public static <N extends Node> N demandNodeOfGivenClass(Node node, Class<N> clazz)
public static ReturnStmt demandReturnStmt(MethodDeclaration method)
public static SwitchStmt demandSwitch(Node node)
public static Optional<VariableDeclarator> demandVariableDeclaration(Node node, String name)
public static Optional<MethodCallExpr> findMethodCall(Node node, String methodName)
@Deprecated public static <N extends Node> N findNodeOfGivenClass(Node node, Class<N> clazz)
demandNodeOfGivenClass(Node, Class)
@Deprecated public static ReturnStmt findReturnStmt(MethodDeclaration method)
demandReturnStmt(MethodDeclaration)
public static Optional<SimpleName> findSimpleName(Node node, String name)
@Deprecated public static SwitchStmt findSwitch(Node node)
demandSwitch(Node)
public static Optional<TypeDeclaration<?>> findType(CompilationUnit cu, String qualifiedName)
public static Optional<TypeDeclaration<?>> findType(TypeDeclaration<?> td, String qualifiedName)
@Deprecated public static Node requireParentNode(Node node)
demandParentNode(Node)
Copyright © 2007–2020. All rights reserved.