Package groovy.grape

Class GrabAnnotationTransformation

All Implemented Interfaces:
CompilationUnitAware, GroovyClassVisitor, GroovyCodeVisitor, ASTTransformation, ErrorCollecting

public class GrabAnnotationTransformation extends ClassCodeVisitorSupport implements ASTTransformation, CompilationUnitAware
Transformation for declarative dependency management.
  • Constructor Details

    • GrabAnnotationTransformation

      public GrabAnnotationTransformation()
  • Method Details

    • getSourceUnit

      public SourceUnit getSourceUnit()
      Provides access to the SourceUnit for error reporting during visitation. Implementations must override this method.
      Specified by:
      getSourceUnit in class ClassCodeVisitorSupport
      Returns:
      the source unit for this visitor
    • setCompilationUnit

      public void setCompilationUnit(CompilationUnit compilationUnit)
      Sets the compilation unit currently applying this transformation.
      Specified by:
      setCompilationUnit in interface CompilationUnitAware
      Parameters:
      compilationUnit - the active compilation unit
    • visit

      public void visit(ASTNode[] nodes, SourceUnit source)
      Visits the source module and processes supported Grape annotations.
      Specified by:
      visit in interface ASTTransformation
      Parameters:
      nodes - the AST nodes to process
      source - the source unit being transformed
    • visitAnnotations

      public void visitAnnotations(AnnotatedNode node)
      Adds the annotation to the internal target list if a match is found.
      Overrides:
      visitAnnotations in class ClassCodeVisitorSupport
      Parameters:
      node - the AST node we are processing