1 46 package org.codehaus.groovy.ast.stmt; 47 48 import org.codehaus.groovy.ast.GroovyCodeVisitor; 49 import org.codehaus.groovy.ast.expr.BooleanExpression; 50 51 57 public class IfStatement extends Statement { 58 59 private BooleanExpression booleanExpression; 60 private Statement ifBlock; 61 private Statement elseBlock; 62 63 64 public IfStatement(BooleanExpression booleanExpression, Statement ifBlock, Statement elseBlock) { 65 this.booleanExpression = booleanExpression; 66 this.ifBlock = ifBlock; 67 this.elseBlock = elseBlock; 68 } 69 70 public void visit(GroovyCodeVisitor visitor) { 71 visitor.visitIfElse(this); 72 } 73 74 public BooleanExpression getBooleanExpression() { 75 return booleanExpression; 76 } 77 78 public Statement getIfBlock() { 79 return ifBlock; 80 } 81 82 public Statement getElseBlock() { 83 return elseBlock; 84 } 85 86 } 87 | Popular Tags |