Interface Symbol
- All Known Subinterfaces:
Symbol.MethodSymbol
,Symbol.TypeSymbol
,Symbol.VariableSymbol
- All Known Implementing Classes:
JLabelSymbol
,Symbols.DefaultSymbol
public interface Symbol
Interface to access symbol information.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Label symbol.static interface
Symbol for methods.static interface
Symbol for a type : class, enum, interface or annotation.static interface
Symbol for field, method parameters and local variables. -
Method Summary
Modifier and TypeMethodDescriptionDeclaration node of this symbol.The closest enclosing class.boolean
boolean
boolean
isEnum()
boolean
isFinal()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isPublic()
boolean
isStatic()
boolean
boolean
boolean
boolean
metadata()
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.
-
Method Details
-
name
String name()Name of this symbol.- Returns:
- simple name of the symbol.
-
owner
The owner of this symbol.- Returns:
- the symbol that owns this symbol, null for package symbols, or unknown symbols
-
type
Type type()Type of symbol.- Returns:
- the type of this symbol.
-
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.
-