KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > reflect > declaration > CtAnnotation


1 package spoon.reflect.declaration;
2
3 import java.lang.annotation.Annotation JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import spoon.reflect.reference.CtTypeReference;
7
8 /**
9  * This element defines an annotation, declared on a given annotated element.
10  *
11  * @param <A> type of represented annotation
12  */

13 public interface CtAnnotation<A extends Annotation JavaDoc> extends CtElement {
14
15     /**
16      * Returns the actual annotation (a dynamic proxy for this element).
17      */

18     A getActualAnnotation();
19
20     /**
21      * Returns the annotation type of this annotation.
22      *
23      * @return a reference to the type of this annotation
24      */

25     CtTypeReference<A> getAnnotationType();
26
27     /**
28      * Searches a value for a given key
29      *
30      * @param key name of searched value
31      * @return the value or null if not found
32      */

33     Object JavaDoc getElementValue(String JavaDoc key);
34
35     /**
36      * Returns this annotation's elements and their values. This is returned in
37      * the form of a map that associates element names with their corresponding
38      * values.
39      *
40      * @return this annotation's element anmes and their values, or an empty map
41      * if there are none
42      */

43     Map JavaDoc<String JavaDoc, Object JavaDoc> getElementValues();
44
45     /**
46      * Sets the annotation's type.
47      *
48      * @param type reference to the type of this annotation
49      */

50     void setAnnotationType(CtTypeReference<? extends Annotation JavaDoc> type);
51
52     /**
53      * Set's this annotation's element names and their values. This is in the
54      * form of a map that associates element names with their corresponding
55      * values.
56      */

57     void setElementValues(Map JavaDoc<String JavaDoc, Object JavaDoc> values);
58
59 }
60
Popular Tags