Package org.codehaus.groovy.ast.stmt

# Class ReturnStatement

java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.stmt.Statement
org.codehaus.groovy.ast.stmt.ReturnStatement

All Implemented Interfaces:
  `NodeMetaDataHandler`

    public class ReturnStatement
    extends Statement

A return statement

- ## Field Summary

  Fields
  Modifier and Type | Field | Description
  --- | --- | ---
  `static ReturnStatement` | `RETURN_NULL_OR_VOID` | Only used for synthetic return statements emitted by the compiler.

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `ReturnStatement​(Expression expression)` |
  `ReturnStatement​(ExpressionStatement statement)` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `Expression` | `getExpression()` |
  `String` | `getText()` |
  `boolean` | `isReturningNullOrVoid()` |
  `void` | `setExpression​(Expression expression)` |
  `String` | `toString()` |
  `void` | `visit​(GroovyCodeVisitor visitor)` |

  ### Methods inherited from class org.codehaus.groovy.ast.stmt.Statement

  `addStatementLabel, copyStatementLabels, getStatementLabel, getStatementLabels, isEmpty, setStatementLabel`

  ### Methods inherited from class org.codehaus.groovy.ast.ASTNode

  `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface org.codehaus.groovy.ast.NodeMetaDataHandler

  `copyNodeMetaData, getNodeMetaData, getNodeMetaData, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setNodeMetaData`

- ## Field Details

  - ### RETURN_NULL_OR_VOID

    public static final ReturnStatement RETURN_NULL_OR_VOID
    Only used for synthetic return statements emitted by the compiler. For comparisons use isReturningNullOrVoid() instead.

- ## Constructor Details

  - ### ReturnStatement

    public ReturnStatement​(ExpressionStatement statement)

  - ### ReturnStatement

    public ReturnStatement​(Expression expression)

- ## Method Details

  - ### getExpression

    public Expression getExpression()

  - ### setExpression

    public void setExpression​(Expression expression)

  - ### getText

    public String getText()
    Overrides:
      `getText` in class `ASTNode`

  - ### isReturningNullOrVoid

    public boolean isReturningNullOrVoid()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### visit

    public void visit​(GroovyCodeVisitor visitor)
    Overrides:
      `visit` in class `ASTNode`