KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > common > annotation > AnnotationVisitor


1 package org.objectweb.celtix.common.annotation;
2
3
4 import java.lang.annotation.Annotation JavaDoc;
5 import java.lang.reflect.Field JavaDoc;
6 import java.lang.reflect.Method JavaDoc;
7 import java.util.List JavaDoc;
8
9 /** Visits the annotated elements of an object
10  *
11  */

12 public interface AnnotationVisitor {
13
14     /** set the target object being visited. Invoked before any of
15      * the visit methods.
16      *
17      * @see AnnotationProcessor
18      *
19      * @param target the target object
20      */

21     void setTarget(Object JavaDoc target);
22
23
24     /** return the list of annotations this visitor wants to be
25      * informed about.
26      *
27      * @return list of annotation types to be informed about
28      *
29      */

30     List JavaDoc<Class JavaDoc<? extends Annotation JavaDoc>> getTargetAnnotations();
31     
32     /** visit an annotated class. Invoked when the class of an object
33      * is annotated by one of the specified annotations.
34      * <code>visitClass</code> is called for each of the annotations
35      * that matches and for each class.
36      *
37      * @param clz the class with the annotation
38      * @param annotation the annotation
39      *
40      */

41     void visitClass(Class JavaDoc<?> clz, Annotation JavaDoc annotation);
42
43     
44     /** visit an annotated field. Invoked when the field of an object
45      * is annotated by one of the specified annotations.
46      * <code>visitField</code> is called for each of the annotations
47      * that matches and for each field.
48      *
49      * @param field the annotated field
50      * @param annotation the annotation
51      *
52      */

53     void visitField(Field JavaDoc field, Annotation JavaDoc annotation);
54
55     /** visit an annotated method. Invoked when the method of an object
56      * is annotated by one of the specified annotations.
57      * <code>visitMethod</code> is called for each of the annotations
58      * that matches and for each method.
59      *
60      * @param method the annotated fieldx
61      * @param annotation the annotation
62      *
63      */

64     void visitMethod(Method JavaDoc method, Annotation JavaDoc annotation);
65 }
66
Popular Tags