< prev index next >

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

Print this page




 436         return false;
 437     }
 438 
 439     /**
 440      * Returns the <i>binary name</i> of a type element.
 441      *
 442      * @param type  the type element being examined
 443      * @return the binary name
 444      *
 445      * @see TypeElement#getQualifiedName
 446      * @jls 13.1 The Form of a Binary
 447      */
 448     Name getBinaryName(TypeElement type);
 449 
 450 
 451     /**
 452      * Returns the package of an element.  The package of a package is
 453      * itself.
 454      * The package of a module is {@code null}.
 455      *
 456      * @param type the element being examined





 457      * @return the package of an element
 458      */
 459     PackageElement getPackageOf(Element type);
 460 
 461     /**
 462      * Returns the module of an element.  The module of a module is
 463      * itself.
 464      * If there is no module for the element, null is returned. One situation where there is
 465      * no module for an element is if the environment does not include modules, such as
 466      * an annotation processing environment configured for
 467      * a {@linkplain






 468      * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
 469      * source version} without modules.




 470      *
 471      * @implSpec The default implementation of this method returns
 472      * {@code null}.
 473      *
 474      * @param type the element being examined
 475      * @return the module of an element
 476      * @since 9
 477      * @spec JPMS
 478      */
 479     default ModuleElement getModuleOf(Element type) {
 480         return null;
 481     }
 482 
 483     /**
 484      * Returns all members of a type element, whether inherited or
 485      * declared directly.  For a class the result also includes its
 486      * constructors, but not local or anonymous classes.
 487      *
 488      * @apiNote Elements of certain kinds can be isolated using
 489      * methods in {@link ElementFilter}.
 490      *
 491      * @param type  the type being examined
 492      * @return all members of the type
 493      * @see Element#getEnclosedElements
 494      */
 495     List<? extends Element> getAllMembers(TypeElement type);
 496 
 497     /**
 498      * Returns all annotations <i>present</i> on an element, whether
 499      * directly present or present via inheritance.




 436         return false;
 437     }
 438 
 439     /**
 440      * Returns the <i>binary name</i> of a type element.
 441      *
 442      * @param type  the type element being examined
 443      * @return the binary name
 444      *
 445      * @see TypeElement#getQualifiedName
 446      * @jls 13.1 The Form of a Binary
 447      */
 448     Name getBinaryName(TypeElement type);
 449 
 450 
 451     /**
 452      * Returns the package of an element.  The package of a package is
 453      * itself.
 454      * The package of a module is {@code null}.
 455      *
 456      * The package of a top-level type is its {@linkplain
 457      * TypeElement#getEnclosingElement enclosing package}. Otherwise,
 458      * the package of an element is equal to the package of the
 459      * {@linkplain Element#getEnclosingElement enclosing element}.
 460      *
 461      * @param e the element being examined
 462      * @return the package of an element
 463      */
 464     PackageElement getPackageOf(Element e);
 465 
 466     /**
 467      * Returns the module of an element.  The module of a module is
 468      * itself.
 469      *
 470      * If a package has a module as its {@linkplain
 471      * PackageElement#getEnclosingElement enclosing element}, that
 472      * module is the module of the package. If the enclosing element
 473      * of a package is {@code null}, {@code null} is returned for the
 474      * package's module.
 475      *
 476      * (One situation where a package may have a {@code null} module
 477      * is if the environment does not include modules, such as an
 478      * annotation processing environment configured for a {@linkplain
 479      * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
 480      * source version} without modules.)
 481      *
 482      * Otherwise, the module of an element is equal to the module
 483      * {@linkplain #getPackageOf(Element) of the package} of the
 484      * element.
 485      *
 486      * @implSpec The default implementation of this method returns
 487      * {@code null}.
 488      *
 489      * @param e the element being examined
 490      * @return the module of an element
 491      * @since 9
 492      * @spec JPMS
 493      */
 494     default ModuleElement getModuleOf(Element e) {
 495         return null;
 496     }
 497 
 498     /**
 499      * Returns all members of a type element, whether inherited or
 500      * declared directly.  For a class the result also includes its
 501      * constructors, but not local or anonymous classes.
 502      *
 503      * @apiNote Elements of certain kinds can be isolated using
 504      * methods in {@link ElementFilter}.
 505      *
 506      * @param type  the type being examined
 507      * @return all members of the type
 508      * @see Element#getEnclosedElements
 509      */
 510     List<? extends Element> getAllMembers(TypeElement type);
 511 
 512     /**
 513      * Returns all annotations <i>present</i> on an element, whether
 514      * directly present or present via inheritance.


< prev index next >