Interface Symbol
- All Known Subinterfaces:
Symbol.MethodSymbol,Symbol.TypeSymbol,Symbol.VariableSymbol
- All Known Implementing Classes:
JLabelSymbol,Symbols.DefaultSymbol,Symbols.RootPackageSymbol,Symbols.UnknownMethodSymbol,Symbols.UnknownSymbol,Symbols.UnkownTypeSymbol
public interface Symbol
Interface to access symbol information.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceLabel symbol.static interfaceSymbol for methods.static interfaceSymbol for a type : class, enum, interface or annotation.static interfaceSymbol for field, method parameters and local variables. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionDeclaration node of this symbol.The closest enclosing class.booleanbooleanbooleanisEnum()booleanisFinal()booleandefault booleanbooleanbooleanbooleandefault booleanbooleanbooleanbooleanisPublic()booleanisStatic()booleanbooleanbooleanbooleanmetadata()Symbol metadata informations, annotations for instance.name()Name of this symbol.owner()The owner of this symbol.type()Type of symbol.usages()The identifier trees that reference this symbol.
-
Field Details
-
ROOT_PACKAGE
-
UNKNOWN_SYMBOL
-
-
Method Details
-
name
-
owner
The owner of this symbol.- Returns:
- the symbol that owns this symbol, null for package symbols, or unknown symbols
-
type
-
isVariableSymbol
boolean isVariableSymbol() -
isTypeSymbol
boolean isTypeSymbol() -
isMethodSymbol
boolean isMethodSymbol() -
isPackageSymbol
boolean isPackageSymbol() -
isStatic
boolean isStatic() -
isFinal
boolean isFinal() -
isEnum
boolean isEnum() -
isInterface
boolean isInterface() -
isAbstract
boolean isAbstract() -
isPublic
boolean isPublic() -
isPrivate
boolean isPrivate() -
isProtected
boolean isProtected() -
isPackageVisibility
boolean isPackageVisibility() -
isDeprecated
boolean isDeprecated() -
isVolatile
boolean isVolatile() -
isUnknown
boolean isUnknown() -
metadata
SymbolMetadata metadata()Symbol metadata informations, annotations for instance.- Returns:
- the metadata of this symbol.
-
enclosingClass
The closest enclosing class.- Returns:
- null for package symbols, themselves for type symbol and enclosing class of methods or variables.
-
usages
List<IdentifierTree> usages()The identifier trees that reference this symbol.- Returns:
- a list of IdentifierTree referencing this symbol. An empty list if this symbol is unused.
-
declaration
Declaration node of this symbol. Currently, only works for declaration within the same file.- Returns:
- the Tree of the declaration of this symbol. Null if declaration does not occur in the currently analyzed file.
-
isLocalVariable
default boolean isLocalVariable()- Returns:
- true if this symbol represents a variable which is a local variable of a method.
-
isParameter
default boolean isParameter()- Returns:
- true if this symbol represents a variable which is a parameter of a method.
-