Package org.sonar.python.semantic
Class ClassSymbolImpl
java.lang.Object
org.sonar.python.semantic.SymbolImpl
org.sonar.python.semantic.ClassSymbolImpl
- All Implemented Interfaces:
ClassSymbol,Symbol
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.symbols.Symbol
Symbol.Kind -
Field Summary
Fields inherited from class org.sonar.python.semantic.SymbolImpl
validForPythonVersions -
Constructor Summary
ConstructorsConstructorDescriptionClassSymbolImpl(String name, String fullyQualifiedName) ClassSymbolImpl(String name, String fullyQualifiedName, LocationInFile location) ClassSymbolImpl(ClassDef classDef, String fullyQualifiedName, PythonFile pythonFile) ClassSymbolImpl(ClassDescriptor classDescriptor, String symbolName) ClassSymbolImpl(SymbolsProtos.ClassSymbol classSymbolProto, String moduleName) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMembers(Collection<Symbol> members) voidaddSuperClass(Symbol symbol) booleancanBeOrExtend(String fullyQualifiedClassName) booleancanHaveMember(String memberName) static ClassSymbolcopyFrom(String name, ClassSymbol classSymbol) booleanbooleanPrecomputed typeshed class symbols might be "lazily evaluated", i.e.booleanbooleanbooleanbooleanbooleanhasUnresolvedTypeHierarchy(boolean includeAmbiguousSymbols) booleanisOrExtends(String fullyQualifiedClassName) booleanisOrExtends(ClassSymbol other) voidresolveMember(String memberName) voidvoidvoidsetMetaclassFQN(String metaclassFQN) voidsetSupportsGenerics(boolean supportsGenerics) booleanMethods inherited from class org.sonar.python.semantic.SymbolImpl
addChildSymbol, annotatedTypeName, copyWithoutUsages, fullyQualifiedName, getChildrenSymbolByName, inferredType, is, kind, name, setAnnotatedTypeName, setInferredType, setKind, usages, validForPythonVersionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sonar.plugins.python.api.symbols.Symbol
annotatedTypeName, fullyQualifiedName, is, kind, name, usages
-
Constructor Details
-
ClassSymbolImpl
public ClassSymbolImpl(ClassDef classDef, @Nullable String fullyQualifiedName, PythonFile pythonFile) -
ClassSymbolImpl
-
ClassSymbolImpl
-
ClassSymbolImpl
-
ClassSymbolImpl
-
-
Method Details
-
copyFrom
-
copyWithoutUsages
- Overrides:
copyWithoutUsagesin classSymbolImpl
-
superClasses
- Specified by:
superClassesin interfaceClassSymbol
-
addSuperClass
-
hasUnresolvedTypeHierarchy
public boolean hasUnresolvedTypeHierarchy()- Specified by:
hasUnresolvedTypeHierarchyin interfaceClassSymbol
-
hasUnresolvedTypeHierarchy
public boolean hasUnresolvedTypeHierarchy(boolean includeAmbiguousSymbols) -
declaredMembers
- Specified by:
declaredMembersin interfaceClassSymbol
-
resolveMember
- Specified by:
resolveMemberin interfaceClassSymbol
-
hasMetaClass
public boolean hasMetaClass() -
canHaveMember
- Specified by:
canHaveMemberin interfaceClassSymbol
-
hasSuperClassWithUnknownMetaClass
public boolean hasSuperClassWithUnknownMetaClass() -
definitionLocation
- Specified by:
definitionLocationin interfaceClassSymbol
-
isOrExtends
- Specified by:
isOrExtendsin interfaceClassSymbol
-
isOrExtends
- Specified by:
isOrExtendsin interfaceClassSymbol
-
canBeOrExtend
- Specified by:
canBeOrExtendin interfaceClassSymbol
-
hasDecorators
public boolean hasDecorators()- Specified by:
hasDecoratorsin interfaceClassSymbol
-
addMembers
-
setHasSuperClassWithoutSymbol
public void setHasSuperClassWithoutSymbol() -
setHasMetaClass
public void setHasMetaClass() -
setMetaclassFQN
-
metaclassFQN
-
removeUsages
public void removeUsages()- Overrides:
removeUsagesin classSymbolImpl
-
hasSuperClassWithoutSymbol
public boolean hasSuperClassWithoutSymbol() -
supportsGenerics
public boolean supportsGenerics() -
setSupportsGenerics
public void setSupportsGenerics(boolean supportsGenerics) -
hasEvaluatedSuperClasses
public boolean hasEvaluatedSuperClasses()Precomputed typeshed class symbols might be "lazily evaluated", i.e. only information about super classes fqn is stored, without having created the actual type hierarchy. This method is used to know if super classes have been already created and added tosuperClasses. This might happen in the following cases: - Super classes have been already read, hence class symbol is not lazy anymore -superClassesFqnsis empty, meaning either this isn't a precomputed typeshed symbol or the class have no superclass.
-