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.ast.ElementGet;
7   
8   public class ASTElementGet extends AbstractEcmascriptNode<ElementGet> {
9       public ASTElementGet(ElementGet elementGet) {
10  	super(elementGet);
11      }
12  
13      /**
14       * Accept the visitor.
15       */
16      @Override
17      public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
18  	return visitor.visit(this, data);
19      }
20  
21      public EcmascriptNode<?> getTarget() {
22          if (jjtGetNumChildren() > 0) {
23              return (EcmascriptNode<?>)jjtGetChild(0);
24          }
25          return null;
26      }
27  
28      public EcmascriptNode<?> getElement() {
29          if (jjtGetNumChildren() > 1) {
30              return (EcmascriptNode<?>)jjtGetChild(1);
31          }
32          return null;
33      }
34  }