KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > annotation > processing > RoundEnvironment


1 /*
2  * @(#)RoundEnvironment.java 1.6 06/08/02
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.annotation.processing;
9
10 import javax.lang.model.element.Element;
11 import javax.lang.model.element.TypeElement;
12 import java.util.Set JavaDoc;
13 import java.lang.annotation.Annotation JavaDoc;
14
15 /**
16  * An annotation processing tool framework will {@linkplain
17  * Processor#process provide an annotation processor with an object
18  * implementing this interface} so that the processor can query for
19  * information about a round of annotation processing.
20  *
21  * @author Joseph D. Darcy
22  * @author Scott Seligman
23  * @author Peter von der Ahé
24  * @version 1.6 06/08/02
25  * @since 1.6
26  */

27 public interface RoundEnvironment {
28     /**
29      * Returns {@code true} if types generated by this round will not
30      * be subject to a subsequent round of annotation processing;
31      * returns {@code false} otherwise.
32      *
33      * @return {@code true} if types generated by this round will not
34      * be subject to a subsequent round of annotation processing;
35      * returns {@code false} otherwise
36      */

37     boolean processingOver();
38  
39     /**
40      * Returns {@code true} if an error was raised in the prior round
41      * of processing; returns {@code false} otherwise.
42      *
43      * @return {@code true} if an error was raised in the prior round
44      * of processing; returns {@code false} otherwise
45      */

46     boolean errorRaised();
47
48     /**
49      * Returns the root elements for annotation processing generated
50      * by the prior round.
51      *
52      * @return the root elements for annotation processing generated
53      * by the prior round, or an empty set if there were none
54      */

55     Set JavaDoc<? extends Element> getRootElements();
56
57     /**
58      * Returns the elements annotated with the given annotation type.
59      * The annotation may appear directly or be inherited.
60      * Only package elements and type elements <i>included</i> in this
61      * round of annotation processing, or declarations of members,
62      * parameters, or type parameters declared within those, are
63      * returned. Included type elements are {@linkplain
64      * #getRootElements root types} and any member types nested within
65      * them. Elements in a package are not considered included simply
66      * because a {@code package-info} file for that package was
67      * created.
68      *
69      * @param a annotation type being requested
70      * @return the elements annotated with the given annotation type,
71      * or an empty set if there are none
72      * @throws IllegalArgumentException if the argument does not
73      * represent an annotation type
74      */

75     Set JavaDoc<? extends Element> getElementsAnnotatedWith(TypeElement a);
76
77     /**
78      * Returns the elements annotated with the given annotation type.
79      * The annotation may appear directly or be inherited.
80      * Only package elements and type elements <i>included</i> in this
81      * round of annotation processing, or declarations of members,
82      * parameters, or type parameters declared within those, are
83      * returned. Included type elements are {@linkplain
84      * #getRootElements root types} and any member types nested within
85      * them. Elements in a package are not considered included simply
86      * because a {@code package-info} file for that package was
87      * created.
88      *
89      * @param a annotation type being requested
90      * @return the elements annotated with the given annotation type,
91      * or an empty set if there are none
92      * @throws IllegalArgumentException if the argument does not
93      * represent an annotation type
94      */

95     Set JavaDoc<? extends Element> getElementsAnnotatedWith(Class JavaDoc<? extends Annotation JavaDoc> a);
96 }
97
Popular Tags