Package io.codemodder.ast
Interface LocalDeclaration
- All Known Implementing Classes:
ExpressionStmtVariableDeclaration,ForEachDeclaration,ForInitDeclaration,LocalVariableDeclaration,ParameterDeclaration,TryResourceDeclaration
public interface LocalDeclaration
A local declaration. Either a local variable declaration, a formal parameter, or an exception
parameter.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Stream<com.github.javaparser.ast.expr.MethodCallExpr>Finds all method calls for the variable/parameter in this declaration.default Stream<com.github.javaparser.ast.expr.NameExpr>Finds all references to this variable/parameter in its scope.com.github.javaparser.ast.NodeThe node where the declaration occurs.getName()Returns the name used in this declaration as a String.getScope()The scope of this declaration.default booleanisReference(com.github.javaparser.ast.expr.NameExpr reference) Verifies if a givenNameExpris a reference to this variable/parameter.
-
Method Details
-
getName
String getName()Returns the name used in this declaration as a String. -
getDeclaration
com.github.javaparser.ast.Node getDeclaration()The node where the declaration occurs. -
getScope
LocalScope getScope()The scope of this declaration. -
isReference
default boolean isReference(com.github.javaparser.ast.expr.NameExpr reference) Verifies if a givenNameExpris a reference to this variable/parameter. -
findAllReferences
Finds all references to this variable/parameter in its scope. -
findAllMethodCalls
Finds all method calls for the variable/parameter in this declaration.
-