public class JavaSymbol extends Object implements Symbol
Modifier and Type | Class and Description |
---|---|
static class |
JavaSymbol.JavaLabelSymbol |
static class |
JavaSymbol.MethodJavaSymbol
Represents a method, constructor or initializer (static or instance).
|
static class |
JavaSymbol.PackageJavaSymbol
Represents package.
|
static class |
JavaSymbol.TypeJavaSymbol
Represents a class, interface, enum or annotation type.
|
static class |
JavaSymbol.TypeVariableJavaSymbol
Represents type variable of a parametrized type ie: T in class Foo
|
static class |
JavaSymbol.VariableJavaSymbol
Represents a field, enum constant, method or constructor parameter, local variable, resource variable or exception parameter.
|
static class |
JavaSymbol.WildcardSymbol |
Symbol.LabelSymbol, Symbol.MethodSymbol, Symbol.TypeSymbol, Symbol.VariableSymbol
Modifier and Type | Field and Description |
---|---|
static int |
ABSENT |
static int |
AMBIGUOUS |
static int |
ERRONEOUS |
static int |
MTH |
static int |
PCK |
static int |
TYP |
static int |
VAR |
Constructor and Description |
---|
JavaSymbol(int kind,
int flags,
String name,
JavaSymbol owner) |
Modifier and Type | Method and Description |
---|---|
void |
addUsage(IdentifierTree tree) |
void |
complete() |
Tree |
declaration()
Declaration node of this symbol.
|
JavaSymbol.TypeJavaSymbol |
enclosingClass()
The closest enclosing class.
|
int |
flags() |
String |
getName() |
JavaType |
getType() |
boolean |
isAbstract() |
boolean |
isDeprecated() |
boolean |
isEnum() |
boolean |
isFinal() |
protected boolean |
isFlag(int flag) |
boolean |
isInterface() |
boolean |
isMethodSymbol() |
boolean |
isPackageSymbol() |
boolean |
isPackageVisibility() |
boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isStatic() |
boolean |
isTypeSymbol() |
boolean |
isUnknown() |
boolean |
isVariableSymbol() |
boolean |
isVolatile() |
SymbolMetadataResolve |
metadata()
Symbol metadata informations, annotations for instance.
|
String |
name()
Name of this symbol.
|
JavaSymbol.TypeJavaSymbol |
outermostClass()
The outermost class which indirectly owns this symbol.
|
JavaSymbol |
owner()
The owner of this symbol.
|
JavaSymbol.PackageJavaSymbol |
packge()
The package which indirectly owns this symbol.
|
Type |
type()
Type of symbol.
|
List<IdentifierTree> |
usages()
The identifier trees that reference this symbol.
|
public static final int PCK
public static final int TYP
public static final int VAR
public static final int MTH
public static final int ERRONEOUS
public static final int AMBIGUOUS
public static final int ABSENT
public JavaSymbol(int kind, int flags, @Nullable String name, @Nullable JavaSymbol owner)
public int flags()
Flags
public JavaSymbol owner()
Symbol
public String getName()
public SymbolMetadataResolve metadata()
Symbol
public void complete()
public JavaSymbol.TypeJavaSymbol outermostClass()
public JavaSymbol.PackageJavaSymbol packge()
public JavaSymbol.TypeJavaSymbol enclosingClass()
enclosingClass
in interface Symbol
public JavaType getType()
public boolean isVariableSymbol()
isVariableSymbol
in interface Symbol
public boolean isTypeSymbol()
isTypeSymbol
in interface Symbol
public boolean isMethodSymbol()
isMethodSymbol
in interface Symbol
public boolean isPackageSymbol()
isPackageSymbol
in interface Symbol
public boolean isInterface()
isInterface
in interface Symbol
public boolean isAbstract()
isAbstract
in interface Symbol
public boolean isProtected()
isProtected
in interface Symbol
public boolean isDeprecated()
isDeprecated
in interface Symbol
public boolean isVolatile()
isVolatile
in interface Symbol
protected boolean isFlag(int flag)
public boolean isPackageVisibility()
isPackageVisibility
in interface Symbol
public void addUsage(IdentifierTree tree)
public List<IdentifierTree> usages()
Symbol
@Nullable public Tree declaration()
Symbol
declaration
in interface Symbol
Copyright © 2012–2017 SonarSource. All rights reserved.