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 LabeledStatementTreedeclaration()Declaration tree of this label.Symbol.TypeSymbolenclosingClass()The closest enclosing class.booleanisUnknown()Stringname()Name of that label.Symbolowner()The owner of this symbol.Typetype()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.LabelSymbolName of that label.- Specified by:
namein interfaceSymbol- Specified by:
namein interfaceSymbol.LabelSymbol- Returns:
- simple name of the symbol.
-
declaration
public LabeledStatementTree declaration()
Description copied from interface:Symbol.LabelSymbolDeclaration tree of this label.- Specified by:
declarationin interfaceSymbol- Specified by:
declarationin 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.LabelSymbolUsages tree of this label.- Specified by:
usagesin interfaceSymbol- Specified by:
usagesin 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:SymbolThe closest enclosing class.- Specified by:
enclosingClassin interfaceSymbol- Returns:
- null for package symbols, themselves for type symbol and enclosing class of methods or variables.
-
-