View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.symboltable;
5   
6   
7   /**
8    * Base class for all name declarations.
9    */
10  public abstract class AbstractNameDeclaration implements NameDeclaration {
11  
12      protected ScopedNode node;
13  
14      public AbstractNameDeclaration(ScopedNode node) {
15          this.node = node;
16      }
17  
18      @Override
19      public ScopedNode getNode() {
20          return node;
21      }
22  
23      @Override
24      public String getImage() {
25          return node.getImage();
26      }
27  
28      @Override
29      public Scope getScope() {
30          return node.getScope();
31      }
32  
33      @Override
34      public String getName() {
35          return getImage();
36      }
37  }