Top Description Fields Constructors Methods
org.codehaus.groovy.transform

public Class AutoFinalASTTransformation

extends AbstractASTTransformation
Class Inheritance
Annotations
@GroovyASTTransformation
phase:SEMANTIC_ANALYSIS
Imports
groovy.transform.AutoFinal, org.codehaus.groovy.ast.ASTNode, .AnnotatedNode, .AnnotationNode, .ClassCodeVisitorSupport, .ClassHelper, .ClassNode, .ConstructorNode, .FieldNode, .MethodNode, .Parameter, org.codehaus.groovy.ast.expr.ClosureExpression, .DeclarationExpression, org.codehaus.groovy.control.CompilePhase, .SourceUnit, java.lang.reflect.Modifier, java.util.Iterator

Handles generation of code for the AutoFinal annotation.

Field Summary

Modifier and TypeField and Description
private static final Class<?>
private static final ClassNode
private AnnotatedNode
Inherited from org.codehaus.groovy.transform.AbstractASTTransformation:
RETENTION_CLASSNODEsourceUnit

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private ClassCodeVisitorSupport
private static boolean
private boolean
private void
process(final ASTNode[] nodes, final ClassCodeVisitorSupport visitor)

private void
processClass(final ClassNode node, final ClassCodeVisitorSupport visitor)

private void
private void
processField(final FieldNode node, final ClassCodeVisitorSupport visitor)

private void
public void
visit(final ASTNode[]
The ASTnodes when the call was triggered. Element 0 is the AnnotationNode that triggered this annotation to be activated. Element 1 is the AnnotatedNode decorated, such as a MethodNode or ClassNode. For global transformations it is usually safe to ignore this parameter.
nodes
,
final SourceUnit
The source unit being compiled. The source unit may contain several classes. For global transformations, information about the AST can be retrieved from this object.
source
)

Implements org.codehaus.groovy.transform.ASTTransformation.visit.

The method is invoked when an AST Transformation is active.
Inherited from org.codehaus.groovy.transform.AbstractASTTransformation:
addErrorcheckIncludeExcludecheckIncludeExcludecheckIncludeExcludeUndefinedAwarecheckIncludeExcludeUndefinedAwarecheckNotInterfacecheckPropertyListcheckPropertyListcheckPropertyListcopyAnnotatedNodeAnnotationscopyAnnotatedNodeAnnotationsdeemedInternalNamegetAnnotationNamegetClassListgetMemberClassListgetMemberClassValuegetMemberClassValuegetMemberIntValuegetMemberListgetMemberStringListgetMemberStringValuegetMemberStringValuegetMemberValuehasAnnotationinitmemberHasValuenonGenericshouldSkipshouldSkipshouldSkipOnDescriptorshouldSkipOnDescriptorUndefinedAwareshouldSkipUndefinedAwareshouldSkipUndefinedAwaretokenize

Field Detail

MY_CLASSback to summary
private static final Class<?> MY_CLASS
MY_TYPEback to summary
private static final ClassNode MY_TYPE
targetback to summary
private AnnotatedNode target

Constructor Detail

AutoFinalASTTransformationback to summary
public AutoFinalASTTransformation()

Method Detail

createVisitorback to summary
private ClassCodeVisitorSupport createVisitor()
hasNoExplicitAutoFinalback to summary
private static boolean hasNoExplicitAutoFinal(final AnnotatedNode node)
isEnabledback to summary
private boolean isEnabled(final AnnotatedNode node)
processback to summary
private void process(final ASTNode[] nodes, final ClassCodeVisitorSupport visitor)
processClassback to summary
private void processClass(final ClassNode node, final ClassCodeVisitorSupport visitor)
processConstructorOrMethodback to summary
private void processConstructorOrMethod(final MethodNode node, final ClassCodeVisitorSupport visitor)
processFieldback to summary
private void processField(final FieldNode node, final ClassCodeVisitorSupport visitor)
processLocalVariableback to summary
private void processLocalVariable(final DeclarationExpression expr, final ClassCodeVisitorSupport visitor)
visitback to summary
public void visit(final ASTNode[] nodes, final SourceUnit source)

Implements org.codehaus.groovy.transform.ASTTransformation.visit.

Doc from org.codehaus.groovy.transform.ASTTransformation.visit.

The method is invoked when an AST Transformation is active. For local transformations, it is invoked once each time the local annotation is encountered. For global transformations, it is invoked once for every source unit, which is typically a source file.

Parameters
nodes:ASTNode[]

The ASTnodes when the call was triggered. Element 0 is the AnnotationNode that triggered this annotation to be activated. Element 1 is the AnnotatedNode decorated, such as a MethodNode or ClassNode. For global transformations it is usually safe to ignore this parameter.

source:SourceUnit

The source unit being compiled. The source unit may contain several classes. For global transformations, information about the AST can be retrieved from this object.

Annotations
@Override