SourceAwareCustomizer (Groovy 4.0.15)

Package: org.codehaus.groovy.control.customizers

## [Java] Class SourceAwareCustomizer

- org.codehaus.groovy.control.customizers.SourceAwareCustomizer

-     public class SourceAwareCustomizer
      extends DelegatingCustomizer

  A base class for customizers which only have to be applied on specific source units. This is for example useful if you want a customizer to be applied only for files matching some extensions.

  For convenience, this class implements several methods that you may extend to customize the behaviour of this utility. For example, if you want to apply a customizer only for classes matching the '.foo' file extension, then you only have to override the acceptExtension(String) method:

      return "foo".equals(extension)

  Since:
    2.1.0

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class DelegatingCustomizer` | `delegate`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `SourceAwareCustomizer(CompilationCustomizer delegate)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `accept(String fileName)`
    `` | `public boolean` | `acceptBaseName(String baseName)`
    `` | `public boolean` | `acceptClass(ClassNode cnode)`
    `` | `public boolean` | `acceptExtension(String extension)`
    `` | `public boolean` | `acceptSource(SourceUnit unit)`
    `` | `public void` | `call(SourceUnit source, GeneratorContext context, ClassNode classNode)`
    `` | `public void` | `setBaseNameValidator(Closure<Boolean> baseNameValidator)`
    `` | `public void` | `setClassValidator(Closure<Boolean> classValidator)`
    `` | `public void` | `setExtensionValidator(Closure<Boolean> extensionValidator)`
    `` | `public void` | `setSourceUnitValidator(Closure<Boolean> sourceUnitValidator)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class DelegatingCustomizer` | `call, setCompilationUnit`
    `class CompilationCustomizer` | `getPhase`

- - ### Constructor Detail

    - #### public SourceAwareCustomizer(CompilationCustomizer delegate)

  - ### Method Detail

    - #### public boolean accept(String fileName)

    - #### public boolean acceptBaseName(String baseName)

    - #### public boolean acceptClass(ClassNode cnode)

    - #### public boolean acceptExtension(String extension)

    - #### public boolean acceptSource(SourceUnit unit)

    - #### @Override
      public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)

    - #### public void setBaseNameValidator(Closure<Boolean> baseNameValidator)

    - #### public void setClassValidator(Closure<Boolean> classValidator)

    - #### public void setExtensionValidator(Closure<Boolean> extensionValidator)

    - #### public void setSourceUnitValidator(Closure<Boolean> sourceUnitValidator)