Class StaticCompileTransformation

java.lang.Object
org.codehaus.groovy.transform.StaticTypesTransformation
org.codehaus.groovy.transform.sc.StaticCompileTransformation
All Implemented Interfaces:
CompilationUnitAware, ASTTransformation

public class StaticCompileTransformation extends StaticTypesTransformation
Handles the implementation of the CompileStatic transformation.
  • Constructor Details

    • StaticCompileTransformation

      public StaticCompileTransformation()
  • Method Details

    • visit

      public void visit(ASTNode[] nodes, SourceUnit source)
      Applies static type checking and rewrites the annotated class or method for static compilation.
      Specified by:
      visit in interface ASTTransformation
      Overrides:
      visit in class StaticTypesTransformation
      Parameters:
      nodes - the annotation node and the annotated target node
      source - the source unit being transformed
    • newVisitor

      protected StaticTypeCheckingVisitor newVisitor(SourceUnit unit, ClassNode node)
      Creates the type checking visitor used by this transformation.
      Overrides:
      newVisitor in class StaticTypesTransformation
      Parameters:
      unit - the source unit being processed
      node - the class node that anchors the visit
      Returns:
      the static compilation visitor for the class