Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/src/share/classes/javax/annotation/processing/RoundEnvironment.java
38913 views
/*1* Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.annotation.processing;2627import javax.lang.model.element.Element;28import javax.lang.model.element.TypeElement;29import java.util.Set;30import java.lang.annotation.Annotation;3132/**33* An annotation processing tool framework will {@linkplain34* Processor#process provide an annotation processor with an object35* implementing this interface} so that the processor can query for36* information about a round of annotation processing.37*38* @author Joseph D. Darcy39* @author Scott Seligman40* @author Peter von der Ahé41* @since 1.642*/43public interface RoundEnvironment {44/**45* Returns {@code true} if types generated by this round will not46* be subject to a subsequent round of annotation processing;47* returns {@code false} otherwise.48*49* @return {@code true} if types generated by this round will not50* be subject to a subsequent round of annotation processing;51* returns {@code false} otherwise52*/53boolean processingOver();5455/**56* Returns {@code true} if an error was raised in the prior round57* of processing; returns {@code false} otherwise.58*59* @return {@code true} if an error was raised in the prior round60* of processing; returns {@code false} otherwise61*/62boolean errorRaised();6364/**65* Returns the root elements for annotation processing generated66* by the prior round.67*68* @return the root elements for annotation processing generated69* by the prior round, or an empty set if there were none70*/71Set<? extends Element> getRootElements();7273/**74* Returns the elements annotated with the given annotation type.75* The annotation may appear directly or be inherited. Only76* package elements and type elements <i>included</i> in this77* round of annotation processing, or declarations of members,78* constructors, parameters, or type parameters declared within79* those, are returned. Included type elements are {@linkplain80* #getRootElements root types} and any member types nested within81* them. Elements in a package are not considered included simply82* because a {@code package-info} file for that package was83* created.84*85* @param a annotation type being requested86* @return the elements annotated with the given annotation type,87* or an empty set if there are none88* @throws IllegalArgumentException if the argument does not89* represent an annotation type90*/91Set<? extends Element> getElementsAnnotatedWith(TypeElement a);9293/**94* Returns the elements annotated with the given annotation type.95* The annotation may appear directly or be inherited. Only96* package elements and type elements <i>included</i> in this97* round of annotation processing, or declarations of members,98* constructors, parameters, or type parameters declared within99* those, are returned. Included type elements are {@linkplain100* #getRootElements root types} and any member types nested within101* them. Elements in a package are not considered included simply102* because a {@code package-info} file for that package was103* created.104*105* @param a annotation type being requested106* @return the elements annotated with the given annotation type,107* or an empty set if there are none108* @throws IllegalArgumentException if the argument does not109* represent an annotation type110*/111Set<? extends Element> getElementsAnnotatedWith(Class<? extends Annotation> a);112}113114115