Class AbstractClassNodeTransformer

    • Constructor Detail

      • AbstractClassNodeTransformer

        public AbstractClassNodeTransformer​(SourceUnit sourceUnit,
                                            Closure<Boolean> criteria)
        Every instance needs the source unit and the name of the class it's going to transform. To find classes eligible to be transformed by this Transformer a Closure returning a boolean is used as a criteria. You can create your own criteria or use one of the static methods present in this class. These methods will create a pre-defined criteria. The Closure used as a criteria will receive a ClassNode and return a Boolean value. If the closure returns true then the transformation will be apply, if not the ClassNode will be discarded.
        Parameters:
        sourceUnit - Needed to apply scope
        criteria - used to locate target classes look for the qualified class)
        Since:
        0.2.0
        See Also:
        Criterias.byClassNodeNameContains(String)