Package org.codehaus.groovy.classgen

# Class ExtendedVerifier

java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.codehaus.groovy.classgen.ExtendedVerifier

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

public class ExtendedVerifier extends ClassCodeVisitorSupport
A specialized Groovy AST visitor meant to perform additional verifications upon the current AST. Currently it does checks on annotated nodes and annotations itself.

Current limitations: - annotations on local variables are not supported

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `JVM_ERROR_MESSAGE`
  Deprecated, for removal: This API element is subject to removal in a future version.
  This constant is no longer used and will be removed in a future version.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ExtendedVerifier(SourceUnit sourceUnit)`
  Creates a new extended verifier.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected SourceUnit`
  `getSourceUnit()`
  Provides access to the `SourceUnit` for error reporting during visitation.
  `protected void`
  `visitAnnotations(AnnotatedNode node, int target)`
  Visits the annotations attached to the supplied node for the given target kind.
  `void`
  `visitClass(ClassNode node)`
  Visits a `ClassNode`, processing its annotations, package, imports, contents, and object initializers.
  `void`
  `visitConstructor(ConstructorNode node)`
  Visits a `ConstructorNode`, processing its annotations, parameter annotations, and code block.
  `void`
  `visitConstructorCallExpression(ConstructorCallExpression expression)`
  Visits a `ConstructorCallExpression`, traversing its argument list.
  `void`
  `visitDeclarationExpression(DeclarationExpression expression)`
  Visits a `DeclarationExpression` with annotation processing, traversing expression annotations before delegating to parent traversal.
  `void`
  `visitField(FieldNode node)`
  Visits a `FieldNode`, processing its annotations and initial value expression if present.
  `void`
  `visitMethod(MethodNode node)`
  Visits a `MethodNode`, processing its annotations, parameter annotations, and code block.
  `void`
  `visitProperty(PropertyNode node)`
  Visits a `PropertyNode`, processing its annotations, initial value expression, and getter/setter blocks if present.
  `protected void`
  `visitStatementAnnotations(Statement statement)`
  Called for each loop statement (`for`, `while`, `do-while`) that carries statement-level annotations.

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

  `addError, visitAnnotation, visitAnnotations, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClassCodeContainer, visitClosureExpression, visitConstructorOrMethod, visitContinueStatement, visitDoWhileLoop, visitExpressionStatement, visitForLoop, visitIfElse, visitImports, visitObjectInitializerStatements, visitPackage, visitReturnStatement, visitStatement, 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, 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`

- ## Field Details

  - ### JVM_ERROR_MESSAGE

    @Deprecated(forRemoval=true, since="5.0.0") public static final String JVM_ERROR_MESSAGE
    Deprecated, for removal: This API element is subject to removal in a future version.
    This constant is no longer used and will be removed in a future version.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ExtendedVerifier

    public ExtendedVerifier(SourceUnit sourceUnit)
    Creates a new extended verifier.
    Parameters:
      `sourceUnit` - the source unit being verified

- ## Method Details

  - ### getSourceUnit

    protected 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

  - ### visitClass

    public void visitClass(ClassNode node)
    Visits a `ClassNode`, processing its annotations, package, imports, contents, and object initializers.
    Specified by:
      `visitClass` in interface `GroovyClassVisitor`
    Overrides:
      `visitClass` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the class node to visit

  - ### visitField

    public void visitField(FieldNode node)
    Visits a `FieldNode`, processing its annotations and initial value expression if present.
    Specified by:
      `visitField` in interface `GroovyClassVisitor`
    Overrides:
      `visitField` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the field node to visit

  - ### visitProperty

    public void visitProperty(PropertyNode node)
    Visits a `PropertyNode`, processing its annotations, initial value expression, and getter/setter blocks if present.
    Specified by:
      `visitProperty` in interface `GroovyClassVisitor`
    Overrides:
      `visitProperty` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the property node to visit

  - ### visitDeclarationExpression

    public void visitDeclarationExpression(DeclarationExpression expression)
    Visits a `DeclarationExpression` with annotation processing, traversing expression annotations before delegating to parent traversal.
    Specified by:
      `visitDeclarationExpression` in interface `GroovyCodeVisitor`
    Overrides:
      `visitDeclarationExpression` in class `ClassCodeVisitorSupport`
    Parameters:
      `expression` - the declaration expression to visit

  - ### visitConstructorCallExpression

    public void visitConstructorCallExpression(ConstructorCallExpression expression)
    Visits a `ConstructorCallExpression`, traversing its argument list.
    Specified by:
      `visitConstructorCallExpression` in interface `GroovyCodeVisitor`
    Overrides:
      `visitConstructorCallExpression` in class `CodeVisitorSupport`
    Parameters:
      `expression` - the constructor call expression

  - ### visitConstructor

    public void visitConstructor(ConstructorNode node)
    Visits a `ConstructorNode`, processing its annotations, parameter annotations, and code block.
    Specified by:
      `visitConstructor` in interface `GroovyClassVisitor`
    Overrides:
      `visitConstructor` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the constructor node to visit

  - ### visitMethod

    public void visitMethod(MethodNode node)
    Visits a `MethodNode`, processing its annotations, parameter annotations, and code block.
    Specified by:
      `visitMethod` in interface `GroovyClassVisitor`
    Overrides:
      `visitMethod` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the method node to visit

  - ### visitStatementAnnotations

    protected void visitStatementAnnotations(Statement statement)
    Called for each loop statement (`for`, `while`, `do-while`) that carries statement-level annotations. Subclasses may override to process those annotations.
    Overrides:
      `visitStatementAnnotations` in class `ClassCodeVisitorSupport`
    Parameters:
      `statement` - the loop statement that may have statement-level annotations

  - ### visitAnnotations

    protected void visitAnnotations(AnnotatedNode node, int target)
    Visits the annotations attached to the supplied node for the given target kind.
    Parameters:
      `node` - the annotated node to inspect
      `target` - the annotation target mask being validated