ASTIfStatement.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.IfStatement;
07 
08 public class ASTIfStatement extends AbstractEcmascriptNode<IfStatement> {
09     public ASTIfStatement(IfStatement ifStatement) {
10   super(ifStatement);
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 boolean hasElse() {
21   return node.getElsePart() != null;
22     }
23 
24     public EcmascriptNode getCondition() {
25   return (EcmascriptNodejjtGetChild(0);
26     }
27 
28     public EcmascriptNode getThen() {
29   return (EcmascriptNodejjtGetChild(1);
30     }
31 
32     public EcmascriptNode getElse() {
33   return (EcmascriptNodejjtGetChild(2);
34     }
35 }