Class ScopeAndDeclarationFinder
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter
-
- net.sourceforge.pmd.lang.java.symboltable.ScopeAndDeclarationFinder
-
- All Implemented Interfaces:
JavaParserVisitor
public class ScopeAndDeclarationFinder extends JavaParserVisitorAdapter
Visitor for scope creation. Visits all nodes of an AST and creates scope objects for nodes representing syntactic entities which may contain declarations. For example, a block may contain variable definitions (which are declarations) and therefore needs a scope object where these declarations can be associated, whereas an expression can't contain declarations and therefore doesn't need a scope object. With the exception of global scopes, each scope object is linked to its parent scope, which is the scope object of the next embedding syntactic entity that has a scope.
-
-
Constructor Summary
Constructors Constructor Description ScopeAndDeclarationFinder()
Creates a newScopeAndDeclarationFinder
using the current class loader.ScopeAndDeclarationFinder(java.lang.ClassLoader classLoader)
Creates a newScopeAndDeclarationFinder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
visit(ASTAnnotationTypeDeclaration node, java.lang.Object data)
java.lang.Object
visit(ASTBlock node, java.lang.Object data)
java.lang.Object
visit(ASTCatchStatement node, java.lang.Object data)
java.lang.Object
visit(ASTClassOrInterfaceBody node, java.lang.Object data)
java.lang.Object
visit(ASTClassOrInterfaceDeclaration node, java.lang.Object data)
java.lang.Object
visit(ASTCompilationUnit node, java.lang.Object data)
java.lang.Object
visit(ASTConstructorDeclaration node, java.lang.Object data)
java.lang.Object
visit(ASTEnumDeclaration node, java.lang.Object data)
java.lang.Object
visit(ASTForStatement node, java.lang.Object data)
java.lang.Object
visit(ASTLambdaExpression node, java.lang.Object data)
java.lang.Object
visit(ASTMethodDeclaration node, java.lang.Object data)
java.lang.Object
visit(ASTSwitchStatement node, java.lang.Object data)
java.lang.Object
visit(ASTTryStatement node, java.lang.Object data)
java.lang.Object
visit(ASTVariableDeclaratorId node, java.lang.Object data)
-
Methods inherited from class net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
-
-
-
Constructor Detail
-
ScopeAndDeclarationFinder
public ScopeAndDeclarationFinder()
Creates a newScopeAndDeclarationFinder
using the current class loader.
-
ScopeAndDeclarationFinder
public ScopeAndDeclarationFinder(java.lang.ClassLoader classLoader)
Creates a newScopeAndDeclarationFinder
.- Parameters:
classLoader
- the class loader to use to resolve types, seeSourceFileScope
andTypeSet
-
-
Method Detail
-
visit
public java.lang.Object visit(ASTCompilationUnit node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTClassOrInterfaceDeclaration node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTEnumDeclaration node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTAnnotationTypeDeclaration node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTClassOrInterfaceBody node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTBlock node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTCatchStatement node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTConstructorDeclaration node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTMethodDeclaration node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTLambdaExpression node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTTryStatement node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTForStatement node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTVariableDeclaratorId node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public java.lang.Object visit(ASTSwitchStatement node, java.lang.Object data)
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
-