View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.ecmascript.ast;
5   
6   import org.mozilla.javascript.Token;
7   import org.mozilla.javascript.ast.VariableDeclaration;
8   
9   public class ASTVariableDeclaration extends AbstractEcmascriptNode<VariableDeclaration> {
10      public ASTVariableDeclaration(VariableDeclaration variableDeclaration) {
11  	super(variableDeclaration);
12  	super.setImage(Token.typeToName(variableDeclaration.getType()).toLowerCase());
13      }
14  
15      /**
16       * Accept the visitor.
17       */
18      public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
19  	return visitor.visit(this, data);
20      }
21  
22      public ASTVariableInitializer getVariableInitializer(int index) {
23  	return (ASTVariableInitializer) jjtGetChild(index);
24      }
25  
26      public boolean isVar() {
27  	return node.isVar();
28      }
29  
30      public boolean isLet() {
31  	return node.isLet();
32      }
33  
34      public boolean isConst() {
35  	return node.isConst();
36      }
37  }