Package org.sonar.python.semantic
Class SymbolImpl
java.lang.Object
org.sonar.python.semantic.SymbolImpl
- All Implemented Interfaces:
Symbol
- Direct Known Subclasses:
AmbiguousSymbolImpl,ClassSymbolImpl,FunctionSymbolImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.symbols.Symbol
Symbol.Kind -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSymbolImpl(String name, String fullyQualifiedName) SymbolImpl(SymbolsProtos.VarSymbol varSymbol, String moduleName, boolean isFromClass) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildSymbol(Symbol symbol) Returns fully qualified name of the type if anycopyWithoutUsages(String name) Note that, for symbols that have been deserialized from protobuf, we compute their type lazily.booleanis(Symbol.Kind... kinds) kind()name()voidvoidsetAnnotatedTypeName(TypeAnnotation typeAnnotation) voidsetInferredType(InferredType inferredType) voidsetKind(Symbol.Kind kind) usages()
-
Field Details
-
validForPythonVersions
-
-
Constructor Details
-
SymbolImpl
-
SymbolImpl
-
-
Method Details
-
name
-
usages
-
fullyQualifiedName
- Specified by:
fullyQualifiedNamein interfaceSymbol
-
is
-
kind
-
setKind
-
addChildSymbol
-
inferredType
Note that, for symbols that have been deserialized from protobuf, we compute their type lazily.a_var : Foo ... class Foo: ...
Here,a_varhas typeFoo, which is defined later. Hence, by resolving types lazily, we avoid having to topologically sort dependencies between types declaration and their usages. -
setInferredType
-
annotatedTypeName
Description copied from interface:SymbolReturns fully qualified name of the type if any- Specified by:
annotatedTypeNamein interfaceSymbol
-
setAnnotatedTypeName
-
copyWithoutUsages
-
copyWithoutUsages
-
removeUsages
public void removeUsages() -
getChildrenSymbolByName
-
validForPythonVersions
-