A Scope does not itself contain the details of the elements corresponding to the parameters, methods and fields of the methods and classes containing its position. However, these elements can be determined from the enclosing elements.
Scopes may be contained in an enclosing scope. The outermost scope contains those elements available via "star import" declarations; the scope within that contains the top level elements of the compilation unit, including any named imports.
| Modifier and Type | Method and Description |
|---|---|
| public TypeElement | Returns: the innermost enclosing type elementReturns the innermost type element containing the position of this scope. |
| public ExecutableElement | Returns: the innermost enclosing method declarationReturns the innermost executable element containing the position of this scope. |
| public Scope | |
| public Iterable | Returns: the elements contained in this scopeReturns the elements directly contained in this scope. |
| getEnclosingClass | back to summary |
|---|---|
| public TypeElement getEnclosingClass() Returns the innermost type element containing the position of this scope.
| |
| getEnclosingMethod | back to summary |
|---|---|
| public ExecutableElement getEnclosingMethod() Returns the innermost executable element containing the position of this scope.
| |
| getEnclosingScope | back to summary |
|---|---|
| public Scope getEnclosingScope() Returns the enclosing scope.
| |
| getLocalElements | back to summary |
|---|---|
| public Iterable Returns the elements directly contained in this scope. | |