public final class ScopeUtil extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
ScopeUtil()
Prevent instantiation.
|
| Modifier and Type | Method and Description |
|---|---|
static Scope |
getDeclaredScopeFromMods(DetailAST aMods)
Returns the
Scope explicitly specified by the modifier set. |
private static Scope |
getDefaultScope(DetailAST ast)
Returns the default
Scope for a DetailAST. |
static Scope |
getScope(DetailAST ast)
Returns the
Scope for a given DetailAST. |
static Scope |
getScopeFromMods(DetailAST aMods)
Returns the
Scope specified by the modifier set. |
static Scope |
getSurroundingScope(DetailAST node)
Returns the scope of the surrounding "block".
|
static boolean |
isClassFieldDef(DetailAST node)
Determines whether a node is a class field definition.
|
static boolean |
isInAnnotationBlock(DetailAST node)
Returns whether a node is directly contained within an annotation block.
|
private static boolean |
isInBlockOf(DetailAST node,
int tokenType)
Returns whether a node is directly contained within a specified block.
|
static boolean |
isInClassBlock(DetailAST node)
Returns whether a node is directly contained within a class block.
|
static boolean |
isInCodeBlock(DetailAST node)
Returns whether the scope of a node is restricted to a code block.
|
static boolean |
isInEnumBlock(DetailAST node)
Returns whether a node is directly contained within an enum block.
|
static boolean |
isInInterfaceBlock(DetailAST node)
Returns whether a node is directly contained within an interface block.
|
static boolean |
isInInterfaceOrAnnotationBlock(DetailAST node)
Returns whether a node is directly contained within an interface or
annotation block.
|
static boolean |
isInRecordBlock(DetailAST node)
Returns whether a node is directly contained within a record block.
|
static boolean |
isInScope(DetailAST ast,
Scope scope)
Checks whether ast node is in a specific scope.
|
static boolean |
isLocalVariableDef(DetailAST node)
Determines whether a node is a local variable definition.
|
static boolean |
isOuterMostType(DetailAST node)
Returns whether a node is contained in the outer most type block.
|
private ScopeUtil()
public static Scope getDeclaredScopeFromMods(DetailAST aMods)
Scope explicitly specified by the modifier set.
Returns null if there are no modifiers.aMods - root node of a modifier setScope value or nullpublic static Scope getScope(DetailAST ast)
Scope for a given DetailAST.ast - the DetailAST to examineScope valuepublic static Scope getScopeFromMods(DetailAST aMods)
Scope specified by the modifier set. If no modifiers are present,
the default scope is used.aMods - root node of a modifier setScope valuegetDefaultScope(DetailAST)private static Scope getDefaultScope(DetailAST ast)
Scope for a DetailAST.
The following rules are taken into account:
ast - DetailAST to processScope valuepublic static Scope getSurroundingScope(DetailAST node)
node - the node to return the scope forpublic static boolean isInClassBlock(DetailAST node)
node - the node to check if directly contained within a class block.boolean valuepublic static boolean isInRecordBlock(DetailAST node)
node - the node to check if directly contained within a record block.boolean valuepublic static boolean isInInterfaceBlock(DetailAST node)
node - the node to check if directly contained within an interface block.boolean valuepublic static boolean isInAnnotationBlock(DetailAST node)
node - the node to check if directly contained within an annotation block.boolean valueprivate static boolean isInBlockOf(DetailAST node, int tokenType)
node - the node to check if directly contained within a specified block.tokenType - type of token.boolean valuepublic static boolean isInInterfaceOrAnnotationBlock(DetailAST node)
node - the node to check if directly contained within an interface
or annotation block.boolean valuepublic static boolean isInEnumBlock(DetailAST node)
node - the node to check if directly contained within an enum block.boolean valuepublic static boolean isInCodeBlock(DetailAST node)
node - the node to checkboolean valuepublic static boolean isOuterMostType(DetailAST node)
node - the node to checkboolean valuepublic static boolean isLocalVariableDef(DetailAST node)
node - the node to check.public static boolean isClassFieldDef(DetailAST node)
node - the node to check.Copyright © 2001-2022. All Rights Reserved.