Package org.apache.groovy.contracts.ast.visitor

# Class AnnotationContractParameterVisitor

java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.apache.groovy.contracts.ast.visitor.BaseVisitor
org.apache.groovy.contracts.ast.visitor.AnnotationContractParameterVisitor

All Implemented Interfaces:
  `GroovyClassVisitor`, `GroovyCodeVisitor`, `ErrorCollecting`

public class AnnotationContractParameterVisitor extends BaseVisitor
This `BaseVisitor` walks up the class hierarchy for the given `ClassNode` and adds `ContractElement` annotations to method parameters.

- ## Field Summary

  ### Fields inherited from class org.apache.groovy.contracts.ast.visitor.BaseVisitor

  `GCONTRACTS_ENABLED_VAR, sourceUnit`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AnnotationContractParameterVisitor(SourceUnit sourceUnit, ReaderSource source)`
  Creates a visitor that scans inherited method parameters for contract annotations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `visitAnnotations(AnnotatedNode node)`
  Triggers contract-meta-annotation lookup for parameter annotations on the current method.
  `void`
  `visitClass(ClassNode node)`
  Visits the class hierarchy and implemented interfaces of the supplied node.
  `void`
  `visitMethod(MethodNode node)`
  Tracks the currently visited method so parameter annotations can be resolved in context.

  ### Methods inherited from class org.apache.groovy.contracts.ast.visitor.BaseVisitor

  `asConditionExecution, getOriginalCondition, getReplacedCondition, getSourceUnit, replaceCondition`

  ### Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport

  `addError, visitAnnotation, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClassCodeContainer, visitClosureExpression, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitObjectInitializerStatements, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitStatementAnnotations, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop`

  ### Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport

  `afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor

  `visit, visit, visitEmptyExpression, visitListOfExpressions`

- ## Constructor Details

  - ### AnnotationContractParameterVisitor

    public AnnotationContractParameterVisitor(SourceUnit sourceUnit, ReaderSource source)
    Creates a visitor that scans inherited method parameters for contract annotations.
    Parameters:
      `sourceUnit` - the source unit currently being transformed
      `source` - the reader source backing the source unit

- ## Method Details

  - ### visitClass

    public void visitClass(ClassNode node)
    Visits the class hierarchy and implemented interfaces of the supplied node.
    Specified by:
      `visitClass` in interface `GroovyClassVisitor`
    Overrides:
      `visitClass` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the class to inspect

  - ### visitMethod

    public void visitMethod(MethodNode node)
    Tracks the currently visited method so parameter annotations can be resolved in context.
    Specified by:
      `visitMethod` in interface `GroovyClassVisitor`
    Overrides:
      `visitMethod` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the method being visited

  - ### visitAnnotations

    public void visitAnnotations(AnnotatedNode node)
    Triggers contract-meta-annotation lookup for parameter annotations on the current method.
    Overrides:
      `visitAnnotations` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the annotated node being visited