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 String
JVM_ERROR_MESSAGE
-
Constructor Summary
Constructors Constructor Description ExtendedVerifier(SourceUnit sourceUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(String msg, ASTNode expr)
protected SourceUnit
getSourceUnit()
protected boolean
isAnnotationCompatible()
Check if the current runtime allows Annotation usage.protected void
visitAnnotations(AnnotatedNode node, int target)
void
visitClass(ClassNode node)
Visit a ClassNode.void
visitConstructor(ConstructorNode node)
Visit a ConstructorNode.void
visitDeclarationExpression(DeclarationExpression expression)
void
visitField(FieldNode node)
Visit a FieldNode.void
visitGenericType(GenericsType genericsType)
void
visitMethod(MethodNode node)
Visit a MethodNode.void
visitProperty(PropertyNode node)
Visit a PropertyNode.-
Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClassCodeContainer, 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
visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression
-
-
-
-
Field Detail
-
JVM_ERROR_MESSAGE
public static final String JVM_ERROR_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExtendedVerifier
public ExtendedVerifier(SourceUnit sourceUnit)
-
-
Method Detail
-
visitClass
public void visitClass(ClassNode node)
Description copied from interface:GroovyClassVisitor
Visit a ClassNode.- Specified by:
visitClass
in interfaceGroovyClassVisitor
- Overrides:
visitClass
in classClassCodeVisitorSupport
-
visitField
public void visitField(FieldNode node)
Description copied from interface:GroovyClassVisitor
Visit a FieldNode.- Specified by:
visitField
in interfaceGroovyClassVisitor
- Overrides:
visitField
in classClassCodeVisitorSupport
-
visitDeclarationExpression
public void visitDeclarationExpression(DeclarationExpression expression)
- Specified by:
visitDeclarationExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitDeclarationExpression
in classClassCodeVisitorSupport
-
visitConstructor
public void visitConstructor(ConstructorNode node)
Description copied from interface:GroovyClassVisitor
Visit a ConstructorNode.- Specified by:
visitConstructor
in interfaceGroovyClassVisitor
- Overrides:
visitConstructor
in classClassCodeVisitorSupport
-
visitMethod
public void visitMethod(MethodNode node)
Description copied from interface:GroovyClassVisitor
Visit a MethodNode.- Specified by:
visitMethod
in interfaceGroovyClassVisitor
- Overrides:
visitMethod
in classClassCodeVisitorSupport
-
visitProperty
public void visitProperty(PropertyNode node)
Description copied from interface:GroovyClassVisitor
Visit a PropertyNode.- Specified by:
visitProperty
in interfaceGroovyClassVisitor
- Overrides:
visitProperty
in classClassCodeVisitorSupport
-
visitAnnotations
protected void visitAnnotations(AnnotatedNode node, int target)
-
isAnnotationCompatible
protected boolean isAnnotationCompatible()
Check if the current runtime allows Annotation usage.- Returns:
- true if running on a 1.5+ runtime
-
addError
public void addError(String msg, ASTNode expr)
- Specified by:
addError
in interfaceErrorCollecting
- Overrides:
addError
in classClassCodeVisitorSupport
-
getSourceUnit
protected SourceUnit getSourceUnit()
- Specified by:
getSourceUnit
in classClassCodeVisitorSupport
-
visitGenericType
public void visitGenericType(GenericsType genericsType)
-
-