org.codehaus.groovy.classgen
Class ExtendedVerifier

java.lang.Object
  extended by org.codehaus.groovy.classgen.ExtendedVerifier
All Implemented Interfaces:
GroovyClassVisitor

public class ExtendedVerifier
extends java.lang.Object
implements GroovyClassVisitor

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

Author:
Alex Popescu

Field Summary
private  ClassNode currentClass
           
static java.lang.String JVM_ERROR_MESSAGE
           
private  SourceUnit source
           
 
Constructor Summary
ExtendedVerifier(SourceUnit sourceUnit)
           
 
Method Summary
protected  void addError(java.lang.String msg, ASTNode expr)
           
protected  boolean isAnnotationCompatible()
          Check if the current runtime allows Annotation usage.
private  AnnotationNode visitAnnotation(AnnotationNode node)
          Resolve metadata and details of the annotation.
protected  void visitAnnotations(AnnotatedNode node, int target)
           
 void visitClass(ClassNode node)
           
 void visitConstructor(ConstructorNode node)
           
 void visitField(FieldNode node)
           
 void visitGenericType(GenericsType genericsType)
           
 void visitMethod(MethodNode node)
           
 void visitProperty(PropertyNode node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JVM_ERROR_MESSAGE

public static final java.lang.String JVM_ERROR_MESSAGE
See Also:
Constant Field Values

source

private SourceUnit source

currentClass

private ClassNode currentClass
Constructor Detail

ExtendedVerifier

public ExtendedVerifier(SourceUnit sourceUnit)
Method Detail

visitClass

public void visitClass(ClassNode node)
Specified by:
visitClass in interface GroovyClassVisitor

visitConstructor

public void visitConstructor(ConstructorNode node)
Specified by:
visitConstructor in interface GroovyClassVisitor

visitField

public void visitField(FieldNode node)
Specified by:
visitField in interface GroovyClassVisitor

visitMethod

public void visitMethod(MethodNode node)
Specified by:
visitMethod in interface GroovyClassVisitor

visitProperty

public void visitProperty(PropertyNode node)
Specified by:
visitProperty in interface GroovyClassVisitor

visitAnnotations

protected void visitAnnotations(AnnotatedNode node,
                                int target)

visitAnnotation

private AnnotationNode visitAnnotation(AnnotationNode node)
Resolve metadata and details of the annotation.


isAnnotationCompatible

protected boolean isAnnotationCompatible()
Check if the current runtime allows Annotation usage.


addError

protected void addError(java.lang.String msg,
                        ASTNode expr)

visitGenericType

public void visitGenericType(GenericsType genericsType)


Copyright © ${year} The Codehaus. All Rights Reserved.