org.codehaus.groovy.ast.tools

## Class ClosureUtils

- java.lang.Object
- - org.codehaus.groovy.ast.tools.ClosureUtils

-     public class ClosureUtils
      extends Object

  Handy methods when working with the Closure expressions.
  Author:
    Hamlet D'Arcy, Sergei Egorov

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClosureUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `convertClosureToSource(ReaderSource readerSource, ClosureExpression expression)` Converts a ClosureExpression into the String source.

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

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

- - ### Constructor Detail

    - #### ClosureUtils

          public ClosureUtils()

  - ### Method Detail

    - #### convertClosureToSource

          public static String convertClosureToSource(ReaderSource readerSource,
                                      ClosureExpression expression)
                                               throws Exception

      Converts a ClosureExpression into the String source.
      Parameters:
        `readerSource` - a source
        `expression` - a closure. Can't be null
      Returns:
        the source the closure was created from
      Throws:
        `IllegalArgumentException` - when expression is null
        `Exception` - when closure can't be read from source