langtools/src/java.compiler/share/classes/javax/annotation/processing/Processor.java
changeset 42815 050370edaade
parent 25874 83c19f00452c
child 43133 08a858022ea6
equal deleted inserted replaced
42814:058fc03646d9 42815:050370edaade
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   113  * <p>An annotation type is considered present if there is at least
   113  * <p>An annotation type is considered present if there is at least
   114  * one annotation of that type present on an element enclosed within
   114  * one annotation of that type present on an element enclosed within
   115  * the root elements of a round. For this purpose, a type parameter is
   115  * the root elements of a round. For this purpose, a type parameter is
   116  * considered to be enclosed by its {@linkplain
   116  * considered to be enclosed by its {@linkplain
   117  * TypeParameterElement#getGenericElement generic
   117  * TypeParameterElement#getGenericElement generic
   118  * element}. Annotations on {@linkplain
   118  * element}.
       
   119 
       
   120  * For this purpose, a package element is <em>not</em> considered to
       
   121  * enclose the top-level types within that package. (A root element
       
   122  * representing a package is created when a {@code package-info} file
       
   123  * is processed.) Likewise, for this purpose, a module element is
       
   124  * <em>not</em> considered to enclose the packages within that
       
   125  * module. (A root element representing a module is created when a
       
   126  * {@code module-info} file is processed.)
       
   127  *
       
   128  * Annotations on {@linkplain
   119  * java.lang.annotation.ElementType#TYPE_USE type uses}, as opposed to
   129  * java.lang.annotation.ElementType#TYPE_USE type uses}, as opposed to
   120  * annotations on elements, are ignored when computing whether or not
   130  * annotations on elements, are ignored when computing whether or not
   121  * an annotation type is present.
   131  * an annotation type is present.
   122  *
   132  *
   123  * <p>An annotation is present if it meets the definition of being
   133  * <p>An annotation is present if it meets the definition of being
   233      * Returns the names of the annotation types supported by this
   243      * Returns the names of the annotation types supported by this
   234      * processor.  An element of the result may be the canonical
   244      * processor.  An element of the result may be the canonical
   235      * (fully qualified) name of a supported annotation type.
   245      * (fully qualified) name of a supported annotation type.
   236      * Alternately it may be of the form &quot;<tt><i>name</i>.*</tt>&quot;
   246      * Alternately it may be of the form &quot;<tt><i>name</i>.*</tt>&quot;
   237      * representing the set of all annotation types with canonical
   247      * representing the set of all annotation types with canonical
   238      * names beginning with &quot;<tt><i>name.</i></tt>&quot;.  Finally, {@code
   248      * names beginning with &quot;<tt><i>name.</i></tt>&quot;.
   239      * "*"} by itself represents the set of all annotation types,
   249      *
   240      * including the empty set.  Note that a processor should not
   250      * In either of those cases, the name of the annotation type can
   241      * claim {@code "*"} unless it is actually processing all files;
   251      * be optionally preceded by a module name followed by a {@code
   242      * claiming unnecessary annotations may cause a performance
   252      * "/"} character. For example, if a processor supports {@code
   243      * slowdown in some environments.
   253      * "a.B"}, this can include multiple annotation types named {@code
       
   254      * a.B} which reside in different modules. To only support {@code
       
   255      * a.B} in the {@code Foo} module, instead use {@code "Foo/a.B"}.
       
   256      *
       
   257      * Finally, {@code "*"} by itself represents the set of all
       
   258      * annotation types, including the empty set.  Note that a
       
   259      * processor should not claim {@code "*"} unless it is actually
       
   260      * processing all files; claiming unnecessary annotations may
       
   261      * cause a performance slowdown in some environments.
   244      *
   262      *
   245      * <p>Each string returned in the set must be accepted by the
   263      * <p>Each string returned in the set must be accepted by the
   246      * following grammar:
   264      * following grammar:
   247      *
   265      *
   248      * <blockquote>
   266      * <blockquote>
   249      * <dl>
   267      * <dl>
   250      * <dt><i>SupportedAnnotationTypeString:</i>
   268      * <dt><i>SupportedAnnotationTypeString:</i>
   251      * <dd><i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub>
   269      * <dd><i>ModulePrefix</i><sub><i>opt</i></sub> <i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub>
   252      * <dd><tt>*</tt>
   270      * <dd><tt>*</tt>
       
   271      *
       
   272      * <dt><i>ModulePrefix:</i>
       
   273      * <dd><i>TypeName</i> <tt>/</tt>
   253      *
   274      *
   254      * <dt><i>DotStar:</i>
   275      * <dt><i>DotStar:</i>
   255      * <dd><tt>.</tt> <tt>*</tt>
   276      * <dd><tt>.</tt> <tt>*</tt>
   256      * </dl>
   277      * </dl>
   257      * </blockquote>
   278      * </blockquote>