|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.control.CompilationUnit.PrimaryClassNodeOperation org.codehaus.groovy.control.customizers.CompilationCustomizer org.codehaus.groovy.control.customizers.DelegatingCustomizer 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)
Field Summary |
---|
Fields inherited from class DelegatingCustomizer | |
---|---|
delegate |
Constructor Summary | |
SourceAwareCustomizer(CompilationCustomizer delegate)
|
Method Summary | |
---|---|
boolean
|
accept(String fileName)
|
boolean
|
acceptBaseName(String baseName)
|
boolean
|
acceptExtension(String extension)
|
boolean
|
acceptSource(SourceUnit unit)
|
void
|
call(SourceUnit source, GeneratorContext context, ClassNode classNode)
|
void
|
setBaseNameValidator(Closure baseNameValidator)
|
void
|
setExtensionValidator(Closure extensionValidator)
|
void
|
setSourceUnitValidator(Closure sourceUnitValidator)
|
Methods inherited from class DelegatingCustomizer | |
---|---|
call |
Methods inherited from class CompilationCustomizer | |
---|---|
getPhase |
Constructor Detail |
---|
public SourceAwareCustomizer(CompilationCustomizer delegate)
Method Detail |
---|
public boolean accept(String fileName)
public boolean acceptBaseName(String baseName)
public boolean acceptExtension(String extension)
public boolean acceptSource(SourceUnit unit)
@Override public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)
public void setBaseNameValidator(Closure baseNameValidator)
public void setExtensionValidator(Closure extensionValidator)
public void setSourceUnitValidator(Closure sourceUnitValidator)
Copyright © 2003-2013 The Codehaus. All rights reserved.