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

public Class StaticCompileTransformation

extends StaticTypesTransformation
Class Inheritance
Annotations
@GroovyASTTransformation
phase:INSTRUCTION_SELECTION
Imports
org.codehaus.groovy.ast.ASTNode, .AnnotatedNode, .AnnotationNode, .ClassNode, .MethodNode, org.codehaus.groovy.ast.expr.Expression, org.codehaus.groovy.classgen.asm.WriterControllerFactory, org.codehaus.groovy.classgen.asm.sc.StaticTypesWriterControllerFactoryImpl, org.codehaus.groovy.control.CompilePhase, .SourceUnit, org.codehaus.groovy.syntax.SyntaxException, org.codehaus.groovy.transform.GroovyASTTransformation, .StaticTypesTransformation, org.codehaus.groovy.transform.sc.transformers.StaticCompilationTransformer, org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor, java.util.Collections, .Map

Handles the implementation of the groovy.transform.CompileStatic transformation.

Field Summary

Modifier and TypeField and Description
private final StaticTypesWriterControllerFactoryImpl
Inherited from org.codehaus.groovy.transform.StaticTypesTransformation:
compilationUnitSTATIC_ERROR_PREFIX

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected StaticTypeCheckingVisitor
newVisitor(final SourceUnit
the source unit
unit
,
final ClassNode
the current classnode
node
)

Overrides org.codehaus.groovy.transform.StaticTypesTransformation.newVisitor.

Allows subclasses to provide their own visitor.
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
)

Overrides org.codehaus.groovy.transform.StaticTypesTransformation.visit.

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

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

Field Detail

factoryback to summary
private final StaticTypesWriterControllerFactoryImpl factory

Constructor Detail

StaticCompileTransformationback to summary
public StaticCompileTransformation()

Method Detail

newVisitorback to summary
protected StaticTypeCheckingVisitor newVisitor(final SourceUnit unit, final ClassNode node)

Overrides org.codehaus.groovy.transform.StaticTypesTransformation.newVisitor.

Doc from org.codehaus.groovy.transform.StaticTypesTransformation.newVisitor.

Allows subclasses to provide their own visitor. This is useful for example for transformations relying on the static type checker.

Parameters
unit:SourceUnit

the source unit

node:ClassNode

the current classnode

Returns:StaticTypeCheckingVisitor

a static type checking visitor

Annotations
@Override
visitback to summary
public void visit(final ASTNode[] nodes, final SourceUnit source)

Overrides org.codehaus.groovy.transform.StaticTypesTransformation.visit.

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