Interface JAccessibleElementSymbol
-
- All Superinterfaces:
AnnotableSymbol
,JElementSymbol
- All Known Subinterfaces:
JClassSymbol
,JConstructorSymbol
,JExecutableSymbol
,JFieldSymbol
,JMethodSymbol
,JTypeDeclSymbol
,JTypeParameterOwnerSymbol
,JTypeParameterSymbol
public interface JAccessibleElementSymbol extends JElementSymbol, AnnotableSymbol
Represents declarations having access modifiers common toJFieldSymbol
,JClassSymbol
,JMethodSymbol
, andJConstructorSymbol
.- Since:
- 7.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
PRIMITIVE_PACKAGE
Conventional return value ofgetPackageName()
for primitive types.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @Nullable JClassSymbol
getEnclosingClass()
Returns the class that directly encloses this declaration.int
getModifiers()
Returns the modifiers of the element represented by this symbol, as decodable by the standardModifier
API.@NonNull String
getPackageName()
Returns the name of the package this element is declared in.default boolean
isStatic()
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.AnnotableSymbol
getDeclaredAnnotation, getDeclaredAnnotations, isAnnotationPresent
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.JElementSymbol
acceptVisitor, equals, getSimpleName, getTypeSystem, isUnresolved, nameEquals, tryGetNode
-
-
-
-
Field Detail
-
PRIMITIVE_PACKAGE
static final String PRIMITIVE_PACKAGE
Conventional return value ofgetPackageName()
for primitive types.- See Also:
- Constant Field Values
-
-
Method Detail
-
getModifiers
int getModifiers()
Returns the modifiers of the element represented by this symbol, as decodable by the standardModifier
API.
-
isStatic
default boolean isStatic()
-
getEnclosingClass
@Nullable JClassSymbol getEnclosingClass()
Returns the class that directly encloses this declaration. This is equivalent toClass.getEnclosingClass()
. Returns null if this is a top-level type declaration.This is necessarily an already resolved symbol, because 1. if it's obtained from reflection, then the enclosing class is available 2. if it's obtained from an AST, then the enclosing class is in the same source file so we can know about it
-
getPackageName
@NonNull String getPackageName()
Returns the name of the package this element is declared in. This recurses into the enclosing elements if needed. If this is an array symbol, returns the package name of the element symbol. If this is a primitive type, returns "java.lang".This is consistent with Java 9's
getPackageName()
.
-
-