< prev index next >

src/java.compiler/share/classes/javax/lang/model/util/Elements.java

Print this page




  81      *
  82      * @param name  the canonical name
  83      * @param module module relative to which the lookup should happen
  84      * @return the named type element, or {@code null} if it cannot be found
  85      * @since 9
  86      */
  87     TypeElement getTypeElement(ModuleElement module, CharSequence name);
  88 
  89     /**
  90      * Returns a module element given its fully qualified name.
  91      * If the named module cannot be found, null is returned. One situation where a module
  92      * cannot be found is if the environment does not include modules, such as
  93      * an annotation processing environment configured for
  94      * a {@linkplain
  95      * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
  96      * source version} without modules.
  97      *
  98      * @param name  the name
  99      * @return the named module element, or {@code null} if it cannot be found
 100      * @since 9

 101      */
 102     ModuleElement getModuleElement(CharSequence name);
 103 
 104     /**
 105      * Returns the values of an annotation's elements, including defaults.
 106      *
 107      * @see AnnotationMirror#getElementValues()
 108      * @param a  annotation to examine
 109      * @return the values of the annotation's elements, including defaults
 110      */
 111     Map<? extends ExecutableElement, ? extends AnnotationValue>
 112             getElementValuesWithDefaults(AnnotationMirror a);
 113 
 114     /**
 115      * Returns the text of the documentation (&quot;Javadoc&quot;)
 116      * comment of an element.
 117      *
 118      * <p> A documentation comment of an element is a comment that
 119      * begins with "{@code /**}" , ends with a separate
 120      * "<code>*/</code>", and immediately precedes the element,


 323      * itself.
 324      *
 325      * @param type the element being examined
 326      * @return the package of an element
 327      */
 328     PackageElement getPackageOf(Element type);
 329 
 330     /**
 331      * Returns the module of an element.  The module of a module is
 332      * itself.
 333      * If there is no module for the element, null is returned. One situation where there is
 334      * no module for an element is if the environment does not include modules, such as
 335      * an annotation processing environment configured for
 336      * a {@linkplain
 337      * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
 338      * source version} without modules.
 339      *
 340      * @param type the element being examined
 341      * @return the module of an element
 342      * @since 9

 343      */
 344     ModuleElement getModuleOf(Element type);
 345 
 346     /**
 347      * Returns all members of a type element, whether inherited or
 348      * declared directly.  For a class the result also includes its
 349      * constructors, but not local or anonymous classes.
 350      *
 351      * <p>Note that elements of certain kinds can be isolated using
 352      * methods in {@link ElementFilter}.
 353      *
 354      * @param type  the type being examined
 355      * @return all members of the type
 356      * @see Element#getEnclosedElements
 357      */
 358     List<? extends Element> getAllMembers(TypeElement type);
 359 
 360     /**
 361      * Returns all annotations <i>present</i> on an element, whether
 362      * directly present or present via inheritance.




  81      *
  82      * @param name  the canonical name
  83      * @param module module relative to which the lookup should happen
  84      * @return the named type element, or {@code null} if it cannot be found
  85      * @since 9
  86      */
  87     TypeElement getTypeElement(ModuleElement module, CharSequence name);
  88 
  89     /**
  90      * Returns a module element given its fully qualified name.
  91      * If the named module cannot be found, null is returned. One situation where a module
  92      * cannot be found is if the environment does not include modules, such as
  93      * an annotation processing environment configured for
  94      * a {@linkplain
  95      * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
  96      * source version} without modules.
  97      *
  98      * @param name  the name
  99      * @return the named module element, or {@code null} if it cannot be found
 100      * @since 9
 101      * @spec JPMS
 102      */
 103     ModuleElement getModuleElement(CharSequence name);
 104 
 105     /**
 106      * Returns the values of an annotation's elements, including defaults.
 107      *
 108      * @see AnnotationMirror#getElementValues()
 109      * @param a  annotation to examine
 110      * @return the values of the annotation's elements, including defaults
 111      */
 112     Map<? extends ExecutableElement, ? extends AnnotationValue>
 113             getElementValuesWithDefaults(AnnotationMirror a);
 114 
 115     /**
 116      * Returns the text of the documentation (&quot;Javadoc&quot;)
 117      * comment of an element.
 118      *
 119      * <p> A documentation comment of an element is a comment that
 120      * begins with "{@code /**}" , ends with a separate
 121      * "<code>*/</code>", and immediately precedes the element,


 324      * itself.
 325      *
 326      * @param type the element being examined
 327      * @return the package of an element
 328      */
 329     PackageElement getPackageOf(Element type);
 330 
 331     /**
 332      * Returns the module of an element.  The module of a module is
 333      * itself.
 334      * If there is no module for the element, null is returned. One situation where there is
 335      * no module for an element is if the environment does not include modules, such as
 336      * an annotation processing environment configured for
 337      * a {@linkplain
 338      * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
 339      * source version} without modules.
 340      *
 341      * @param type the element being examined
 342      * @return the module of an element
 343      * @since 9
 344      * @spec JPMS
 345      */
 346     ModuleElement getModuleOf(Element type);
 347 
 348     /**
 349      * Returns all members of a type element, whether inherited or
 350      * declared directly.  For a class the result also includes its
 351      * constructors, but not local or anonymous classes.
 352      *
 353      * <p>Note that elements of certain kinds can be isolated using
 354      * methods in {@link ElementFilter}.
 355      *
 356      * @param type  the type being examined
 357      * @return all members of the type
 358      * @see Element#getEnclosedElements
 359      */
 360     List<? extends Element> getAllMembers(TypeElement type);
 361 
 362     /**
 363      * Returns all annotations <i>present</i> on an element, whether
 364      * directly present or present via inheritance.


< prev index next >