< prev index next >

src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java

Print this page




  36  * @author Scott Seligman
  37  * @author Peter von der Ah&eacute;
  38  * @see javax.lang.model.util.Elements#getPackageOf
  39  * @since 1.6
  40  */
  41 public interface PackageElement extends Element, QualifiedNameable {
  42     /**
  43      * Returns a {@linkplain javax.lang.model.type.NoType pseudo-type}
  44      * for this package.
  45      * @return a pseudo-type for this package
  46      *
  47      * @see javax.lang.model.type.NoType
  48      * @see javax.lang.model.type.TypeKind#PACKAGE
  49      */
  50     @Override
  51     TypeMirror asType();
  52 
  53     /**
  54      * Returns the fully qualified name of this package.
  55      * This is also known as the package's <i>canonical</i> name.
  56      * For an {@linkplain #isUnnamed() unnamed package}, an empty name is returned.
  57      *
  58      * @apiNote The fully qualified name of a named package that is
  59      * not a subpackage of a named package is its simple name. The
  60      * fully qualified name of a named package that is a subpackage of
  61      * another named package consists of the fully qualified name of
  62      * the containing package, followed by "{@code .}", followed by the simple
  63      * (member) name of the subpackage.
  64      *
  65      * @return the fully qualified name of this package, or an
  66      * empty name if this is an unnamed package
  67      * @jls 6.7 Fully Qualified Names and Canonical Names
  68      */
  69     Name getQualifiedName();
  70 
  71     /**
  72      * Returns the simple name of this package.  For an {@linkplain
  73      * #isUnnamed() unnamed package}, an empty name is returned.
  74      *
  75      * @return the simple name of this package or an empty name if
  76      * this is an unnamed package
  77      */
  78     @Override
  79     Name getSimpleName();
  80 
  81     /**
  82      * Returns the {@linkplain NestingKind#TOP_LEVEL top-level}
  83      * classes and interfaces within this package.  Note that
  84      * subpackages are <em>not</em> considered to be enclosed by a
  85      * package.
  86      *
  87      * @return the top-level classes and interfaces within this
  88      * package
  89      */
  90     @Override
  91     List<? extends Element> getEnclosedElements();
  92 
  93     /**




  36  * @author Scott Seligman
  37  * @author Peter von der Ah&eacute;
  38  * @see javax.lang.model.util.Elements#getPackageOf
  39  * @since 1.6
  40  */
  41 public interface PackageElement extends Element, QualifiedNameable {
  42     /**
  43      * Returns a {@linkplain javax.lang.model.type.NoType pseudo-type}
  44      * for this package.
  45      * @return a pseudo-type for this package
  46      *
  47      * @see javax.lang.model.type.NoType
  48      * @see javax.lang.model.type.TypeKind#PACKAGE
  49      */
  50     @Override
  51     TypeMirror asType();
  52 
  53     /**
  54      * Returns the fully qualified name of this package.
  55      * This is also known as the package's <i>canonical</i> name.
  56      * For an {@linkplain #isUnnamed() unnamed package}, an {@linkplain Name#isEmpty() empty name} is returned.
  57      *
  58      * @apiNote The fully qualified name of a named package that is
  59      * not a subpackage of a named package is its simple name. The
  60      * fully qualified name of a named package that is a subpackage of
  61      * another named package consists of the fully qualified name of
  62      * the containing package, followed by "{@code .}", followed by the simple
  63      * (member) name of the subpackage.
  64      *
  65      * @return the fully qualified name of this package, or an
  66      * empty name if this is an unnamed package
  67      * @jls 6.7 Fully Qualified Names and Canonical Names
  68      */
  69     Name getQualifiedName();
  70 
  71     /**
  72      * Returns the simple name of this package.  For an {@linkplain
  73      * #isUnnamed() unnamed package}, an {@linkplain Name#isEmpty() empty name} is returned.
  74      *
  75      * @return the simple name of this package or an empty name if
  76      * this is an unnamed package
  77      */
  78     @Override
  79     Name getSimpleName();
  80 
  81     /**
  82      * Returns the {@linkplain NestingKind#TOP_LEVEL top-level}
  83      * classes and interfaces within this package.  Note that
  84      * subpackages are <em>not</em> considered to be enclosed by a
  85      * package.
  86      *
  87      * @return the top-level classes and interfaces within this
  88      * package
  89      */
  90     @Override
  91     List<? extends Element> getEnclosedElements();
  92 
  93     /**


< prev index next >