Interface RoundEnvironment

    • Method Detail

      • processingOver

        boolean processingOver()
        Returns true if types generated by this round will not be subject to a subsequent round of annotation processing; returns false otherwise.
        Returns:
        true if types generated by this round will not be subject to a subsequent round of annotation processing; returns false otherwise
      • errorRaised

        boolean errorRaised()
        Returns true if an error was raised in the prior round of processing; returns false otherwise.
        Returns:
        true if an error was raised in the prior round of processing; returns false otherwise
      • getRootElements

        Set<? extends Element> getRootElements()
        Returns the root elements for annotation processing generated by the prior round.
        Returns:
        the root elements for annotation processing generated by the prior round, or an empty set if there were none
      • getElementsAnnotatedWith

        Set<? extends Element> getElementsAnnotatedWith​(TypeElement a)
        Returns the elements annotated with the given annotation type. The annotation may appear directly or be inherited. Only package elements, module elements, and type elements included in this round of annotation processing, or declarations of members, constructors, parameters, or type parameters declared within those, are returned. Included type elements are root types and any member types nested within them. Elements of a package are not considered included simply because a package-info file for that package was created. Likewise, elements of a module are not considered included simply because a module-info file for that module was created
        Parameters:
        a - annotation type being requested
        Returns:
        the elements annotated with the given annotation type, or an empty set if there are none
        Throws:
        IllegalArgumentException - if the argument does not represent an annotation type
      • getElementsAnnotatedWithAny

        default Set<? extends Element> getElementsAnnotatedWithAny​(TypeElement... annotations)
        Returns the elements annotated with one or more of the given annotation types.
        Parameters:
        annotations - annotation types being requested
        Returns:
        the elements annotated with one or more of the given annotation types, or an empty set if there are none
        Throws:
        IllegalArgumentException - if the any elements of the argument set do not represent an annotation type
        Since:
        9
      • getElementsAnnotatedWith

        Set<? extends Element> getElementsAnnotatedWith​(Class<? extends Annotation> a)
        Returns the elements annotated with the given annotation type. The annotation may appear directly or be inherited. Only package elements, module elements, and type elements included in this round of annotation processing, or declarations of members, constructors, parameters, or type parameters declared within those, are returned. Included type elements are root types and any member types nested within them. Elements in a package are not considered included simply because a package-info file for that package was created. Likewise, elements of a module are not considered included simply because a module-info file for that module was created
        Parameters:
        a - annotation type being requested
        Returns:
        the elements annotated with the given annotation type, or an empty set if there are none
        Throws:
        IllegalArgumentException - if the argument does not represent an annotation type
      • getElementsAnnotatedWithAny

        default Set<? extends Element> getElementsAnnotatedWithAny​(Set<Class<? extends Annotation>> annotations)
        Returns the elements annotated with one or more of the given annotation types.
        Parameters:
        annotations - annotation types being requested
        Returns:
        the elements annotated with one or more of the given annotation types, or an empty set if there are none
        Throws:
        IllegalArgumentException - if the any elements of the argument set do not represent an annotation type
        Since:
        9