Class QualifiedNameResolver
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter
-
- net.sourceforge.pmd.lang.java.ast.JavaParserVisitorReducedAdapter
-
- net.sourceforge.pmd.lang.java.qname.QualifiedNameResolver
-
- All Implemented Interfaces:
JavaParserVisitor
@Deprecated @InternalApi public class QualifiedNameResolver extends JavaParserVisitorReducedAdapter
Deprecated.Is internal APIPopulatesJavaQualifiableNode
instances with their qualified names.- Since:
- 6.1.0
- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description QualifiedNameResolver()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
initializeWith(ClassLoader classLoader, ASTCompilationUnit rootNode)
Deprecated.Initialises the visitor and starts it.Object
visit(ASTAllocationExpression node, Object data)
Deprecated.Object
visit(ASTAnyTypeDeclaration node, Object data)
Deprecated.Object
visit(ASTCompilationUnit node, Object data)
Deprecated.Object
visit(ASTConstructorDeclaration node, Object data)
Deprecated.Object
visit(ASTEnumConstant node, Object data)
Deprecated.Object
visit(ASTLambdaExpression node, Object data)
Deprecated.Populates the qualified name of a lambda expression.Object
visit(ASTMethodDeclaration node, Object data)
Deprecated.-
Methods inherited from class net.sourceforge.pmd.lang.java.ast.JavaParserVisitorReducedAdapter
visit, visit, visit, visit, visit, visit
-
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, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
-
-
-
Method Detail
-
initializeWith
public void initializeWith(ClassLoader classLoader, ASTCompilationUnit rootNode)
Deprecated.Initialises the visitor and starts it.- Parameters:
classLoader
- The classloader that will be used by type qualified names to load their type.rootNode
- The root hierarchy
-
visit
public Object visit(ASTCompilationUnit node, Object data)
Deprecated.- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public Object visit(ASTAnyTypeDeclaration node, Object data)
Deprecated.- Overrides:
visit
in classJavaParserVisitorReducedAdapter
-
visit
public Object visit(ASTAllocationExpression node, Object data)
Deprecated.- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public Object visit(ASTEnumConstant node, Object data)
Deprecated.- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorAdapter
-
visit
public Object visit(ASTMethodDeclaration node, Object data)
Deprecated.- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorReducedAdapter
-
visit
public Object visit(ASTConstructorDeclaration node, Object data)
Deprecated.- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorReducedAdapter
-
visit
public Object visit(ASTLambdaExpression node, Object data)
Deprecated.Populates the qualified name of a lambda expression. The qualified name of a lambda is made up:- Of the qualified name of the innermost enclosing type (considering anonymous classes too);
- The operation string is composed of the following
segments, separated with a dollar ($) symbol:
- The
lambda
keyword; - A keyword identifying the scope the lambda
was declared in. It can be:
new
, if the lambda is declared in an instance initializer, or a constructor, or in the initializer of an instance field of an outer or nested classstatic
, if the lambda is declared in a static initializer, or in the initializer of a static field (including interface constants),null
, if the lambda is declared inside another lambda,- The innermost enclosing type's simple name, if the lambda is declared in the field initializer of a local class,
- The innermost enclosing method's name, if the lambda is declared inside a method,
- Nothing (empty string), if the lambda is declared in the initializer of the field of an anonymous class;
- A numeric index, unique for each lambda declared within the same type declaration.
- The
The operation string of a lambda does not contain any formal parameters.
This specification was worked out from stack traces. The precise order in which the numeric index is assigned does not conform to the way javac assigns them. Doing that could allow us to retrieve the Method instance associated with the lambda. TODO
See this stackoverflow answer for more info about how lambdas are compiled.
- Specified by:
visit
in interfaceJavaParserVisitor
- Overrides:
visit
in classJavaParserVisitorReducedAdapter
- Parameters:
node
- Lambda expression node
-
-