Overview | Package | Class
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.classgen
Class AnnotationVisitor

An Annotation visitor responsible with: - reading annotation metadata (

:
  Retention, @Target, attribute types)

- verify that an `AnnotationNode` conforms to annotation meta - enhancing an `AnnotationNode` AST to reflect real annotation meta

author:
  Alex Popescu

Field Summary
`def` | `EMPTY_ARGS`
`def` | `EMPTY_ARG_TYPES`
`AnnotationNode` | `annotation`
`Class` | `annotationClass`
`Class` | `annotationRootClass`
`Map` | `defaultAttrTypes`
`ErrorCollector` | `errorCollector`
`Map` | `requiredAttrTypes`
`SourceUnit` | `source`

Constructor Summary
`AnnotationVisitor(SourceUnit source, ErrorCollector errorCollector)`

Method Summary
`void` | `addError(String msg)`
`void` | `addError(String msg, ASTNode expr)`
`void` | `extractAnnotationMeta(Class annotationClass)`
`Class` | `getAttributeType(String attr)`
`void` | `initializeAnnotationMeta(Class annotationClass)`
`void` | `initializeAttributeTypes(Class annotationClass)`
`void` | `initializeRetention(Class annotationClass, Class retentionClass, Object retentionAnnotation)`
`void` | `initializeTarget(Class annotationClass, Class targetClass, Object targetAnnotation)`
`Object` | `invoke(Class clazz, String methodName, def argTypes, Object target, def args)`
`boolean` | `isAnnotation(Class clazz)`
`boolean` | `isEnum(Class clazz)`
`boolean` | `isValidAnnotationClass(AnnotationNode node)`
`Class` | `loadAnnotationRootClass()`
`AnnotationNode` | `visit(AnnotationNode node)`
`void` | `visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, Class attrType)`
`void` | `visitConstantExpression(String attrName, ConstantExpression constExpr, ClassNode attrType)`
`void` | `visitEnumExpression(String attrName, PropertyExpression propExpr, ClassNode attrType)`
`void` | `visitExpression(String attrName, Expression attrAst, Class attrType)`
`void` | `visitListExpression(String attrName, ListExpression listExpr, Class elementType)`

Constructor Detail

### AnnotationVisitor

    public AnnotationVisitor(SourceUnit source, ErrorCollector errorCollector)

Method Detail

### addError

    void addError(String msg)

### addError

    void addError(String msg, ASTNode expr)

### extractAnnotationMeta

    void extractAnnotationMeta(Class annotationClass)

### getAttributeType

    Class getAttributeType(String attr)

### initializeAnnotationMeta

    void initializeAnnotationMeta(Class annotationClass)

### initializeAttributeTypes

    void initializeAttributeTypes(Class annotationClass)

### initializeRetention

    void initializeRetention(Class annotationClass, Class retentionClass, Object retentionAnnotation)

### initializeTarget

    void initializeTarget(Class annotationClass, Class targetClass, Object targetAnnotation)

### invoke

    Object invoke(Class clazz, String methodName, def argTypes, Object target, def args)

### isAnnotation

    boolean isAnnotation(Class clazz)

### isEnum

    boolean isEnum(Class clazz)

### isValidAnnotationClass

    boolean isValidAnnotationClass(AnnotationNode node)

  param:
    node
  return:

### loadAnnotationRootClass

    Class loadAnnotationRootClass()

### visit

    public AnnotationNode visit(AnnotationNode node)

### visitAnnotationExpression

    void visitAnnotationExpression(String attrName, AnnotationConstantExpression expression, Class attrType)

  param:
    attrName
  param:
    expression
  param:
    attrType

### visitConstantExpression

    void visitConstantExpression(String attrName, ConstantExpression constExpr, ClassNode attrType)

### visitEnumExpression

    void visitEnumExpression(String attrName, PropertyExpression propExpr, ClassNode attrType)

### visitExpression

    void visitExpression(String attrName, Expression attrAst, Class attrType)

### visitListExpression

    void visitListExpression(String attrName, ListExpression listExpr, Class elementType)