Class ClosureUtils


  • public class ClosureUtils
    extends java.lang.Object
    Handy methods when working with the Closure expressions.
    Author:
    Hamlet D'Arcy, Sergei Egorov
    • Constructor Detail

      • ClosureUtils

        public ClosureUtils()
    • Method Detail

      • convertClosureToSource

        public static java.lang.String convertClosureToSource​(ReaderSource readerSource,
                                                              ClosureExpression expression)
                                                       throws java.lang.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:
        java.lang.IllegalArgumentException - when expression is null
        java.lang.Exception - when closure can't be read from source