Package org.codehaus.groovy.ast.tools
Class ClosureUtils
java.lang.Object
org.codehaus.groovy.ast.tools.ClosureUtils
Handy methods when working with the Closure expressions.
- Author:
- Hamlet D'Arcy, Sergei Egorov
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertClosureToSource
(ReaderSource readerSource, ClosureExpression expression) Converts a ClosureExpression into the String source.
-
Constructor Details
-
ClosureUtils
public ClosureUtils()
-
-
Method Details
-
convertClosureToSource
public static String convertClosureToSource(ReaderSource readerSource, ClosureExpression expression) throws Exception Converts a ClosureExpression into the String source.- Parameters:
readerSource
- a sourceexpression
- a closure. Can't be null- Returns:
- the source the closure was created from
- Throws:
IllegalArgumentException
- when expression is nullException
- when closure can't be read from source
-