KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > mirror > declaration > AnnotationMirror


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

7
8 package com.sun.mirror.declaration;
9
10 import java.util.Map JavaDoc;
11 import com.sun.mirror.type.AnnotationType;
12 import com.sun.mirror.util.SourcePosition;
13
14
15 /**
16  * Represents an annotation. An annotation associates a value with
17  * each element of an annotation type.
18  *
19  * <p> Annotations should not be compared using reference-equality
20  * ("<tt>==</tt>"). There is no guarantee that any particular
21  * annotation will always be represented by the same object.
22  *
23  * @author Joseph D. Darcy
24  * @author Scott Seligman
25  * @version 1.5 04/07/16
26  * @since 1.5
27  */

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

36     AnnotationType getAnnotationType();
37
38     /**
39      * Returns the source position of the beginning of this annotation.
40      * Returns null if the position is unknown or not applicable.
41      *
42      * <p>This source position is intended for use in providing diagnostics,
43      * and indicates only approximately where an annotation begins.
44      *
45      * @return the source position of the beginning of this annotation or
46      * null if the position is unknown or not applicable
47      */

48     SourcePosition getPosition();
49
50     /**
51      * Returns this annotation's elements and their values.
52      * This is returned in the form of a map that associates elements
53      * with their corresponding values.
54      * Only those elements and values explicitly present in the
55      * annotation are included, not those that are implicitly assuming
56      * their default values.
57      * The order of the map matches the order in which the
58      * elements appear in the annotation's source.
59      *
60      * @return this annotation's elements and their values,
61      * or an empty map if there are none
62      */

63     Map JavaDoc<AnnotationTypeElementDeclaration, AnnotationValue> getElementValues();
64 }
65
Popular Tags