ASTCatchClause.java
01 /**
02  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03  */
04 package net.sourceforge.pmd.lang.ecmascript.ast;
05 
06 import org.mozilla.javascript.ast.CatchClause;
07 
08 public class ASTCatchClause extends AbstractEcmascriptNode<CatchClause> {
09     public ASTCatchClause(CatchClause catchClause) {
10   super(catchClause);
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 ASTName getVariableName() {
22   return (ASTNamejjtGetChild(0);
23     }
24 
25     public boolean isIf() {
26   return node.getCatchCondition() != null;
27     }
28 
29     public EcmascriptNode getCatchCondition() {
30   return (EcmascriptNodejjtGetChild(1);
31     }
32 
33     public ASTBlock getBlock() {
34   return (ASTBlockjjtGetChild(jjtGetNumChildren() 1);
35     }
36 }