Interface Symbol
-
- All Known Subinterfaces:
Symbol.MethodSymbol,Symbol.TypeSymbol,Symbol.VariableSymbol
- All Known Implementing Classes:
JavaSymbol,JavaSymbol.JavaLabelSymbol,JavaSymbol.MethodJavaSymbol,JavaSymbol.PackageJavaSymbol,JavaSymbol.TypeJavaSymbol,JavaSymbol.TypeVariableJavaSymbol,JavaSymbol.VariableJavaSymbol,JavaSymbol.WildcardSymbol,Resolve.AccessErrorJavaSymbol,Resolve.AmbiguityErrorJavaSymbol,Resolve.JavaSymbolNotFound
public interface SymbolInterface to access symbol information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSymbol.LabelSymbolLabel symbol.static interfaceSymbol.MethodSymbolSymbol for methods.static interfaceSymbol.TypeSymbolSymbol for a type : class, enum, interface or annotation.static interfaceSymbol.VariableSymbolSymbol for field, method parameters and local variables.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Treedeclaration()Declaration node of this symbol.Symbol.TypeSymbolenclosingClass()The closest enclosing class.booleanisAbstract()booleanisDeprecated()booleanisEnum()booleanisFinal()booleanisInterface()booleanisMethodSymbol()booleanisPackageSymbol()booleanisPackageVisibility()booleanisPrivate()booleanisProtected()booleanisPublic()booleanisStatic()booleanisTypeSymbol()booleanisUnknown()booleanisVariableSymbol()booleanisVolatile()SymbolMetadatametadata()Symbol metadata informations, annotations for instance.Stringname()Name of this symbol.Symbolowner()The owner of this symbol.Typetype()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
Symbol owner()
The owner of this symbol.- Returns:
- the symbol that owns this symbol.
-
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.
-
-