Returns the innermost element
within which this element is, loosely speaking, enclosed.
- If this element is one whose declaration is lexically enclosed
immediately within the declaration of another element, that other
element is returned.
- If this is a top-level type, its package is returned.
- If this is a package, its module is
returned if such a module exists. Otherwise,
null
is returned.
- If this is a type parameter,
the of the type parameter is returned.
- If this is a method or constructor, the executable which declares the parameter is returned.
- If this is a module,
null
is returned.
Returns: the enclosing element, or null
if there is none
See also:
Elements.getPackageOf
@revised 9
@spec JPMS