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 Classes Modifier and Type Interface Description static interface
Symbol.LabelSymbol
Label symbol.static interface
Symbol.MethodSymbol
Symbol for methods.static interface
Symbol.TypeSymbol
Symbol for a type : class, enum, interface or annotation.static interface
Symbol.VariableSymbol
Symbol for field, method parameters and local variables.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tree
declaration()
Declaration node of this symbol.Symbol.TypeSymbol
enclosingClass()
The closest enclosing class.boolean
isAbstract()
boolean
isDeprecated()
boolean
isEnum()
boolean
isFinal()
boolean
isInterface()
boolean
isMethodSymbol()
boolean
isPackageSymbol()
boolean
isPackageVisibility()
boolean
isPrivate()
boolean
isProtected()
boolean
isPublic()
boolean
isStatic()
boolean
isTypeSymbol()
boolean
isUnknown()
boolean
isVariableSymbol()
boolean
isVolatile()
SymbolMetadata
metadata()
Symbol metadata informations, annotations for instance.String
name()
Name of this symbol.Symbol
owner()
The owner of this symbol.Type
type()
Type of symbol.List<IdentifierTree>
usages()
The identifier trees that reference this symbol.
-
-
-
Method Detail
-
name
String name()
Name of this symbol.- Returns:
- simple name of the symbol.
-
owner
@Nullable 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
@Nullable Symbol.TypeSymbol 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.
-
-