KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > lang > model > element > AnnotationMirror


1 /*
2  * @(#)AnnotationMirror.java 1.4 06/07/11
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.lang.model.element;
9
10 import java.util.Map JavaDoc;
11 import javax.lang.model.type.DeclaredType;
12
13 /**
14  * Represents an annotation. An annotation associates a value with
15  * each element of an annotation type.
16  *
17  * <p> Annotations should be compared using the {@code equals}
18  * method. There is no guarantee that any particular annotation will
19  * always be represented by the same object.
20  *
21  * @author Joseph D. Darcy
22  * @author Scott Seligman
23  * @author Peter von der Ah&eacute;
24  * @version 1.4 06/07/11
25  * @since 1.6
26  */

27 public interface AnnotationMirror {
28
29     /**
30      * Returns the type of this annotation.
31      *
32      * @return the type of this annotation
33      */

34     DeclaredType getAnnotationType();
35
36     /**
37      * Returns the values of this annotation's elements.
38      * This is returned in the form of a map that associates elements
39      * with their corresponding values.
40      * Only those elements with values explicitly present in the
41      * annotation are included, not those that are implicitly assuming
42      * their default values.
43      * The order of the map matches the order in which the
44      * values appear in the annotation's source.
45      *
46      * <p>Note that an annotation mirror of a marker annotation type
47      * will by definition have an empty map.
48      *
49      * <p>To fill in default values, use {@link
50      * javax.lang.model.util.Elements#getElementValuesWithDefaults
51      * getElementValuesWithDefaults}.
52      *
53      * @return the values of this annotation's elements,
54      * or an empty map if there are none
55      */

56     Map JavaDoc<? extends ExecutableElement, ? extends AnnotationValue> getElementValues();
57 }
58
Popular Tags