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.VariableInitializer;
    7
    8   public class ASTVariableInitializer extends AbstractEcmascriptNode<VariableInitializer> implements DestructuringNode {
    9       public ASTVariableInitializer(VariableInitializer variableInitializer) {
    10  	super(variableInitializer);
    11      }
    12
    13      /**
    14       * Accept the visitor.
    15       */
    16      public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
    17  	return visitor.visit(this, data);
    18      }
    19
    20      public EcmascriptNode getTarget() {
    21  	return (EcmascriptNode) jjtGetChild(0);
    22      }
    23
    24      public EcmascriptNode getInitializer() {
    25  	if (jjtGetNumChildren() > 0) {
    26  	    return (EcmascriptNode) jjtGetChild(1);
    27  	} else {
    28  	    return null;
    29  	}
    30      }
    31
    32      public boolean isDestructuring() {
    33  	return node.isDestructuring();
    34      }
    35  }