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
| Modifiers | Name | Description |
|---|---|---|
static String |
JVM_ERROR_MESSAGE |
|
| Constructor and description |
|---|
ExtendedVerifier(SourceUnit sourceUnit)Creates a new extended verifier. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected SourceUnit |
getSourceUnit()* Provides access to the SourceUnit for error reporting during visitation. * Implementations must override this method. * *
|
|
protected void |
visitAnnotations(AnnotatedNode node, int target)Visits the annotations attached to the supplied node for the given target kind. |
|
public void |
visitClass(ClassNode node)* Visits a ClassNode, processing its annotations, package, imports, contents, and object initializers. * *
|
|
public void |
visitConstructor(ConstructorNode node)* Visits a ConstructorNode, processing its annotations, parameter annotations, and code block. * *
|
|
public void |
visitConstructorCallExpression(ConstructorCallExpression expression)* Visits a ConstructorCallExpression, traversing its argument list. * *
|
|
public void |
visitDeclarationExpression(DeclarationExpression expression)* Visits a DeclarationExpression with annotation processing, traversing expression annotations * before delegating to parent traversal. * *
|
|
public void |
visitField(FieldNode node)* Visits a FieldNode, processing its annotations and initial value expression if present. * *
|
|
public void |
visitMethod(MethodNode node)* Visits a MethodNode, processing its annotations, parameter annotations, and code block. * *
|
|
public 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. Subclasses may override to process those annotations.
*
*
|
Creates a new extended verifier.
sourceUnit - the source unit being verified* Provides access to the SourceUnit for error reporting during visitation. * Implementations must override this method. * *
Visits the annotations attached to the supplied node for the given target kind.
node - the annotated node to inspecttarget - the annotation target mask being validated* Visits a ClassNode, processing its annotations, package, imports, contents, and object initializers. * *
node - the class node to visit* Visits a ConstructorNode, processing its annotations, parameter annotations, and code block. * *
node - the constructor node to visit* Visits a ConstructorCallExpression, traversing its argument list. * *
call - the constructor call expression* Visits a DeclarationExpression with annotation processing, traversing expression annotations * before delegating to parent traversal. * *
expression - the declaration expression to visit* Visits a FieldNode, processing its annotations and initial value expression if present. * *
node - the field node to visit* Visits a MethodNode, processing its annotations, parameter annotations, and code block. * *
node - the method node to visit* Visits a PropertyNode, processing its annotations, initial value expression, * and getter/setter blocks if present. * *
node - the property node to visit
* Called for each loop statement (for, while, do-while) that
* carries statement-level annotations. Subclasses may override to process those annotations.
*
*
statement - the loop statement that may have statement-level annotations
*Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.