Package org.sonar.java.model
Class JLabelSymbol
- java.lang.Object
-
- org.sonar.java.resolve.Symbols.DefaultSymbol
-
- org.sonar.java.model.JLabelSymbol
-
- All Implemented Interfaces:
Symbol
,Symbol.LabelSymbol
public class JLabelSymbol extends Symbols.DefaultSymbol implements Symbol.LabelSymbol
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.java.api.semantic.Symbol
Symbol.LabelSymbol, Symbol.MethodSymbol, Symbol.TypeSymbol, Symbol.VariableSymbol
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabeledStatementTree
declaration()
Declaration tree of this label.Symbol.TypeSymbol
enclosingClass()
The closest enclosing class.boolean
isUnknown()
String
name()
Name of that label.Symbol
owner()
The owner of this symbol.Type
type()
Type of symbol.List<IdentifierTree>
usages()
Usages tree of this label.-
Methods inherited from class org.sonar.java.resolve.Symbols.DefaultSymbol
isAbstract, isDeprecated, isEnum, isFinal, isInterface, isMethodSymbol, isPackageSymbol, isPackageVisibility, isPrivate, isProtected, isPublic, isStatic, isTypeSymbol, isVariableSymbol, isVolatile, metadata
-
-
-
-
Method Detail
-
name
public String name()
Description copied from interface:Symbol.LabelSymbol
Name of that label.- Specified by:
name
in interfaceSymbol
- Specified by:
name
in interfaceSymbol.LabelSymbol
- Returns:
- simple name of the symbol.
-
declaration
public LabeledStatementTree declaration()
Description copied from interface:Symbol.LabelSymbol
Declaration tree of this label.- Specified by:
declaration
in interfaceSymbol
- Specified by:
declaration
in interfaceSymbol.LabelSymbol
- Returns:
- the Tree of the declaration of this symbol. Null if declaration does not occur in the currently analyzed file.
-
usages
public List<IdentifierTree> usages()
Description copied from interface:Symbol.LabelSymbol
Usages tree of this label.- Specified by:
usages
in interfaceSymbol
- Specified by:
usages
in interfaceSymbol.LabelSymbol
- Returns:
- a list of IdentifierTree referencing this symbol. An empty list if this symbol is unused.
-
enclosingClass
@Nullable public Symbol.TypeSymbol enclosingClass()
Description copied from interface:Symbol
The closest enclosing class.- Specified by:
enclosingClass
in interfaceSymbol
- Returns:
- null for package symbols, themselves for type symbol and enclosing class of methods or variables.
-
-