org.codehaus.groovy.classgen

## Class ReturnAdder

- java.lang.Object
- - org.codehaus.groovy.classgen.ReturnAdder

-     public class ReturnAdder
      extends Object

  Utility class to add return statements.

  Extracted from Verifier as it can be useful for some AST transformations.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `ReturnAdder.ReturnStatementListener`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReturnAdder()`
    `ReturnAdder(ReturnAdder.ReturnStatementListener listener)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addReturnIfNeeded(MethodNode node)` Deprecated. Use `visitMethod(MethodNode)` instead.
    `void` | `visitMethod(MethodNode node)` Adds return statements to given method whenever an implicit return is detected.

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

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

- - ### Constructor Detail

    - #### ReturnAdder

          public ReturnAdder()

    - #### ReturnAdder

          public ReturnAdder(ReturnAdder.ReturnStatementListener listener)

  - ### Method Detail

    - #### addReturnIfNeeded

          @Deprecated
          public static void addReturnIfNeeded(MethodNode node)

      Deprecated. Use `visitMethod(MethodNode)` instead.

    - #### visitMethod

          public void visitMethod(MethodNode node)

      Adds return statements to given method whenever an implicit return is detected.