Class AnnotationProcessorVisitor

All Implemented Interfaces:
GroovyClassVisitor, GroovyCodeVisitor, ErrorCollecting

public class AnnotationProcessorVisitor extends BaseVisitor
Visits annotations of meta-type ContractElement and applies the AST transformations of the underlying AnnotationProcessor implementation.
See Also:
  • Constructor Details

    • AnnotationProcessorVisitor

      public AnnotationProcessorVisitor(SourceUnit sourceUnit, ReaderSource source, ProcessingContextInformation pci)
      Creates a visitor that dispatches contract annotations to their registered processors.
      Parameters:
      sourceUnit - the source unit currently being transformed
      source - the reader source backing the source unit
      pci - per-class processing context shared across the contracts pipeline
  • Method Details

    • visitClass

      public void visitClass(ClassNode type)
      Processes contract annotations declared on the class, its methods, inherited interfaces, and relevant abstract base methods.
      Specified by:
      visitClass in interface GroovyClassVisitor
      Overrides:
      visitClass in class ClassCodeVisitorSupport
      Parameters:
      type - the class currently being transformed
    • getAnnotationProcessor

      public static AnnotationProcessor getAnnotationProcessor(String name)
      Instantiates the annotation processor with the supplied implementation class name.
      Parameters:
      name - the fully qualified processor class name
      Returns:
      the instantiated processor, or null if it could not be created