public class VerifierCodeVisitor
extends CodeVisitorSupport
Performs various checks on code inside methods and constructors including checking for valid field, variables names etc. that would otherwise lead to invalid code.
| Constructor and description |
|---|
VerifierCodeVisitor(ClassNode classNode)Creates a new verifier code visitor for the given class. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static void |
assertValidIdentifier(String name, String message, ASTNode node)Verifies that the supplied name is a valid Java identifier. |
|
public void |
visitConstructorCallExpression(ConstructorCallExpression call)* Visits a ConstructorCallExpression, traversing its argument list. * *
|
|
public void |
visitFieldExpression(FieldExpression expression)* Visits a FieldExpression. No traversal is performed as field expressions contain no child expressions. * *
|
|
public void |
visitForLoop(ForStatement statement)* Visits a ForStatement, traversing the collection expression and loop body. * *
|
|
public void |
visitListExpression(ListExpression expression)* Visits a ListExpression, traversing all contained expressions. * *
|
|
public void |
visitVariableExpression(VariableExpression expression)* Visits a VariableExpression. No traversal is performed as variable expressions contain no child expressions. * *
|
Creates a new verifier code visitor for the given class.
classNode - the class node being verifiedVerifies that the supplied name is a valid Java identifier.
name - the identifier text to validatemessage - the error context to include in failuresnode - the node to associate with any parse error* Visits a ConstructorCallExpression, traversing its argument list. * *
call - the constructor call expression* Visits a FieldExpression. No traversal is performed as field expressions contain no child expressions. * *
expression - the field expression* Visits a ForStatement, traversing the collection expression and loop body. * *
statement - the for loop statement* Visits a ListExpression, traversing all contained expressions. * *
expression - the list expression* Visits a VariableExpression. No traversal is performed as variable expressions contain no child expressions. * *
expression - the variable expressionCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.