1 46 package org.codehaus.groovy.ast.stmt; 47 48 import org.codehaus.groovy.ast.GroovyCodeVisitor; 49 import org.codehaus.groovy.ast.expr.ConstantExpression; 50 import org.codehaus.groovy.ast.expr.Expression; 51 52 58 public class ReturnStatement extends Statement { 59 60 public static final ReturnStatement RETURN_NULL_OR_VOID = new ReturnStatement(ConstantExpression.NULL); 61 62 private Expression expression; 63 64 public ReturnStatement(Expression expression) { 65 this.expression = expression; 66 } 67 68 public void visit(GroovyCodeVisitor visitor) { 69 visitor.visitReturnStatement(this); 70 } 71 72 public Expression getExpression() { 73 return expression; 74 } 75 76 public String getText() { 77 return "return " + expression.getText(); 78 } 79 80 } 81 | Popular Tags |