public class GenericsVisitor
extends ClassCodeVisitorSupport
Verify correct usage of generics. This includes:
<> usage| Constructor and description |
|---|
GenericsVisitor(SourceUnit source)Creates a visitor that validates generic type usage for one source unit. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected SourceUnit |
getSourceUnit()Returns the source unit currently being verified. |
|
public void |
visitArrayExpression(ArrayExpression expression)Validates generic usage for array element types. |
|
public void |
visitCastExpression(CastExpression expression)Validates generic usage for cast target types. |
|
public void |
visitClass(ClassNode node)Validates generic usage in a class header and its contents. |
|
public void |
visitConstructorCallExpression(ConstructorCallExpression expression)Validates generic usage on constructor call types. |
|
protected void |
visitConstructorOrMethod(MethodNode node, boolean isConstructor)Validates generic usage for a constructor or method signature. |
|
public void |
visitDeclarationExpression(DeclarationExpression expression)Validates generic usage in declared variable types. |
|
public void |
visitField(FieldNode node)Validates generic usage for a field declaration. |
Creates a visitor that validates generic type usage for one source unit.
source - the source unit being verifiedReturns the source unit currently being verified.
Validates generic usage for array element types.
expression - the array expression to inspectValidates generic usage for cast target types.
expression - the cast expression to inspectValidates generic usage in a class header and its contents.
node - the class to inspectValidates generic usage on constructor call types.
expression - the constructor call to inspectValidates generic usage for a constructor or method signature.
node - the executable member to inspectisConstructor - whether node is a constructorValidates generic usage in declared variable types.
expression - the declaration expression to inspectValidates generic usage for a field declaration.
node - the field to inspectCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.