API Note
The represented package may have an explicit reference
representation (either source code or executable output) or may be
created from implicit information. The explicit and standalone
source code construct for a package is typically a package-info.java
file (JLS 7.4.1). A named package
without a standalone package-info.java
file can be declared
in the package declaration of a top-level class or interface. Implicit information is used to
model unnamed packages (JLS 7.4.2).
In the context of annotation processing, a package element can be:
javax.lang.model.util.Elements#getPackageOf
Modifier and Type | Method and Description |
---|---|
public TypeMirror | Returns: a pseudo-type for this packageRedeclares javax. Returns a pseudo-type for this package. |
public List | Returns: the top-level classes and interfaces within this packageRedeclares javax. Returns the top-level classes and interfaces within this package. |
public Element | Returns: the enclosing module if such a module exists; otherwisenull Redeclares javax. Returns the enclosing module if such a module exists; otherwise
|
public Name | Returns: the fully qualified name of this package, or an empty name if this is an unnamed packageRedeclares javax. Returns the fully qualified name of this package. |
public Name | Returns: the simple name of this package or an empty name if this is an unnamed packageRedeclares javax. Returns the simple name of this package. |
public boolean | Returns: true if this is an unnamed package and false otherwiseReturns |
asType | back to summary |
---|---|
public TypeMirror asType() Redeclares javax. Returns a pseudo-type for this package.
|
getEnclosedElements | back to summary |
---|---|
public List Redeclares javax. Returns the top-level classes and interfaces within this package. Note that subpackages are not considered to be enclosed by a package. |
getEnclosingElement | back to summary |
---|---|
public Element getEnclosingElement() Redeclares javax. Returns the enclosing module if such a module exists; otherwise
|
getQualifiedName | back to summary |
---|---|
public Name getQualifiedName() Redeclares javax. Returns the fully qualified name of this package. This is also known as the package's canonical name. For an unnamed package, an empty name is returned. API Note The fully qualified name of a named package that is
not a subpackage of a named package is its simple name. The
fully qualified name of a named package that is a subpackage of
another named package consists of the fully qualified name of
the containing package, followed by "
|
getSimpleName | back to summary |
---|---|
public Name getSimpleName() Redeclares javax. Returns the simple name of this package. For an unnamed package, an empty name is returned. |
isUnnamed | back to summary |
---|---|
public boolean isUnnamed() Returns
|