1 package net.sourceforge.pmd.symboltable;
2
3 import net.sourceforge.pmd.ast.ASTVariableDeclaratorId;
4 import net.sourceforge.pmd.ast.AccessNode;
5
6 public class VariableNameDeclaration extends AbstractNameDeclaration implements NameDeclaration {
7
8 public VariableNameDeclaration(ASTVariableDeclaratorId node) {
9 super(node);
10 }
11
12 public Scope getScope() {
13 return node.getScope().getEnclosingClassScope();
14 }
15
16 public boolean isExceptionBlockParameter() {
17 return ((ASTVariableDeclaratorId) node).isExceptionBlockParameter();
18 }
19
20 public AccessNode getAccessNodeParent() {
21 return (AccessNode) node.jjtGetParent().jjtGetParent();
22 }
23
24 public boolean equals(Object o) {
25 VariableNameDeclaration n = (VariableNameDeclaration) o;
26 return n.node.getImage().equals(node.getImage());
27 }
28
29 public int hashCode() {
30 return node.getImage().hashCode();
31 }
32
33 public String toString() {
34 return "Variable symbol " + node.getImage() + " line " + node.getBeginLine();
35 }
36 }
This page was automatically generated by Maven