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
public class ClassSymbolImpl extends SymbolImpl implements ClassSymbol
-
-
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
Constructors Constructor Description ClassSymbolImpl(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
-
Methods inherited from class org.sonar.python.semantic.SymbolImpl
addChildSymbol, annotatedTypeName, fullyQualifiedName, getChildrenSymbolByName, inferredType, is, kind, name, setAnnotatedTypeName, setInferredType, setKind, usages, validForPythonVersions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sonar.plugins.python.api.symbols.Symbol
annotatedTypeName, fullyQualifiedName, is, kind, name, usages
-
-
-
-
Constructor Detail
-
ClassSymbolImpl
public ClassSymbolImpl(ClassDef classDef, @Nullable String fullyQualifiedName, PythonFile pythonFile)
-
ClassSymbolImpl
public ClassSymbolImpl(String name, @Nullable String fullyQualifiedName, LocationInFile location)
-
ClassSymbolImpl
public ClassSymbolImpl(ClassDescriptor classDescriptor, String symbolName)
-
ClassSymbolImpl
public ClassSymbolImpl(SymbolsProtos.ClassSymbol classSymbolProto, String moduleName)
-
-
Method Detail
-
copyFrom
public static ClassSymbol copyFrom(String name, ClassSymbol classSymbol)
-
copyWithoutUsages
public ClassSymbolImpl copyWithoutUsages()
- Overrides:
copyWithoutUsagesin classSymbolImpl
-
superClasses
public List<Symbol> superClasses()
- Specified by:
superClassesin interfaceClassSymbol
-
addSuperClass
public void addSuperClass(Symbol symbol)
-
hasUnresolvedTypeHierarchy
public boolean hasUnresolvedTypeHierarchy()
- Specified by:
hasUnresolvedTypeHierarchyin interfaceClassSymbol
-
hasUnresolvedTypeHierarchy
public boolean hasUnresolvedTypeHierarchy(boolean includeAmbiguousSymbols)
-
declaredMembers
public Set<Symbol> declaredMembers()
- Specified by:
declaredMembersin interfaceClassSymbol
-
resolveMember
public Optional<Symbol> resolveMember(String memberName)
- Specified by:
resolveMemberin interfaceClassSymbol
-
hasMetaClass
public boolean hasMetaClass()
-
canHaveMember
public boolean canHaveMember(String memberName)
- Specified by:
canHaveMemberin interfaceClassSymbol
-
hasSuperClassWithUnknownMetaClass
public boolean hasSuperClassWithUnknownMetaClass()
-
definitionLocation
public LocationInFile definitionLocation()
- Specified by:
definitionLocationin interfaceClassSymbol
-
isOrExtends
public boolean isOrExtends(String fullyQualifiedClassName)
- Specified by:
isOrExtendsin interfaceClassSymbol
-
isOrExtends
public boolean isOrExtends(ClassSymbol other)
- Specified by:
isOrExtendsin interfaceClassSymbol
-
canBeOrExtend
public boolean canBeOrExtend(String fullyQualifiedClassName)
- Specified by:
canBeOrExtendin interfaceClassSymbol
-
hasDecorators
public boolean hasDecorators()
- Specified by:
hasDecoratorsin interfaceClassSymbol
-
addMembers
public void addMembers(Collection<Symbol> members)
-
setHasSuperClassWithoutSymbol
public void setHasSuperClassWithoutSymbol()
-
setHasMetaClass
public void setHasMetaClass()
-
setMetaclassFQN
public void setMetaclassFQN(String metaclassFQN)
-
metaclassFQN
@CheckForNull public String 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.
-
-