< prev index next >

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

Print this page




  25 
  26 package javax.lang.model.element;
  27 
  28 import java.util.List;
  29 
  30 /**
  31  * Represents a module program element.  Provides access to
  32  * information about the module, its directives, and its members.
  33  *
  34  * @see javax.lang.model.util.Elements#getModuleOf
  35  * @since 9
  36  * @jls 7.7 Module Declarations
  37  * @spec JPMS
  38  */
  39 public interface ModuleElement extends Element, QualifiedNameable {
  40 
  41     /**
  42      * Returns the fully qualified name of this module.  For an
  43      * {@linkplain #isUnnamed() unnamed module}, an empty name is returned.
  44      *






  45      * @return the fully qualified name of this module, or an
  46      * empty name if this is an unnamed module


  47      */
  48     @Override
  49     Name getQualifiedName();
  50 
  51     /**
  52      * Returns the simple name of this module.  For an {@linkplain
  53      * #isUnnamed() unnamed module}, an empty name is returned.
  54      *






  55      * @return the simple name of this module or an empty name if
  56      * this is an unnamed module


  57      */
  58     @Override
  59     Name getSimpleName();
  60 
  61     /**
  62      * Returns the packages within this module.
  63      * @return the packages within this module
  64      */
  65     @Override
  66     List<? extends Element> getEnclosedElements();
  67 
  68     /**
  69      * Returns {@code true} if this is an open module and {@code
  70      * false} otherwise.
  71      *
  72      * @return {@code true} if this is an open module and {@code
  73      * false} otherwise
  74      */ // TODO: add @jls to unnamed module section
  75     boolean isOpen();
  76 




  25 
  26 package javax.lang.model.element;
  27 
  28 import java.util.List;
  29 
  30 /**
  31  * Represents a module program element.  Provides access to
  32  * information about the module, its directives, and its members.
  33  *
  34  * @see javax.lang.model.util.Elements#getModuleOf
  35  * @since 9
  36  * @jls 7.7 Module Declarations
  37  * @spec JPMS
  38  */
  39 public interface ModuleElement extends Element, QualifiedNameable {
  40 
  41     /**
  42      * Returns the fully qualified name of this module.  For an
  43      * {@linkplain #isUnnamed() unnamed module}, an empty name is returned.
  44      *
  45      * @apiNote If the module name consists of one identifier, then
  46      * this method returns that identifier, which is deemed to be
  47      * module's fully qualified name despite not being in qualified
  48      * form.  If the module name consists of more than one identifier,
  49      * then this method returns the entire name.
  50      *
  51      * @return the fully qualified name of this module, or an
  52      * empty name if this is an unnamed module
  53      *
  54      * @jls 6.2 Names and Identifiers
  55      */
  56     @Override
  57     Name getQualifiedName();
  58 
  59     /**
  60      * Returns the simple name of this module.  For an {@linkplain
  61      * #isUnnamed() unnamed module}, an empty name is returned.
  62      *
  63      * @apiNote If the module name consists of one identifier, then
  64      * this method returns that identifier.  If the module name
  65      * consists of more than one identifier, then this method returns
  66      * the rightmost such identifier, which is deemed to be the
  67      * module's simple name.
  68      *
  69      * @return the simple name of this module or an empty name if
  70      * this is an unnamed module
  71      *
  72      * @jls 6.2 Names and Identifiers
  73      */
  74     @Override
  75     Name getSimpleName();
  76 
  77     /**
  78      * Returns the packages within this module.
  79      * @return the packages within this module
  80      */
  81     @Override
  82     List<? extends Element> getEnclosedElements();
  83 
  84     /**
  85      * Returns {@code true} if this is an open module and {@code
  86      * false} otherwise.
  87      *
  88      * @return {@code true} if this is an open module and {@code
  89      * false} otherwise
  90      */ // TODO: add @jls to unnamed module section
  91     boolean isOpen();
  92 


< prev index next >