public class SourceAwareCustomizer extends DelegatingCustomizer
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)
delegate
Constructor and Description |
---|
SourceAwareCustomizer(CompilationCustomizer delegate) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.lang.String fileName) |
boolean |
acceptBaseName(java.lang.String baseName) |
boolean |
acceptClass(ClassNode cnode) |
boolean |
acceptExtension(java.lang.String extension) |
boolean |
acceptSource(SourceUnit unit) |
void |
call(SourceUnit source,
GeneratorContext context,
ClassNode classNode) |
void |
setBaseNameValidator(Closure<java.lang.Boolean> baseNameValidator) |
void |
setClassValidator(Closure<java.lang.Boolean> classValidator) |
void |
setExtensionValidator(Closure<java.lang.Boolean> extensionValidator) |
void |
setSourceUnitValidator(Closure<java.lang.Boolean> sourceUnitValidator) |
getPhase
needSortedInput
public SourceAwareCustomizer(CompilationCustomizer delegate)
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException
call
in class DelegatingCustomizer
CompilationFailedException
public void setBaseNameValidator(Closure<java.lang.Boolean> baseNameValidator)
public void setExtensionValidator(Closure<java.lang.Boolean> extensionValidator)
public void setSourceUnitValidator(Closure<java.lang.Boolean> sourceUnitValidator)
public void setClassValidator(Closure<java.lang.Boolean> classValidator)
public boolean accept(java.lang.String fileName)
public boolean acceptClass(ClassNode cnode)
public boolean acceptSource(SourceUnit unit)
public boolean acceptExtension(java.lang.String extension)
public boolean acceptBaseName(java.lang.String baseName)