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
  • Constructor Details

  • Method Details

    • copyFrom

      public static ClassSymbol copyFrom(String name, ClassSymbol classSymbol)
    • copyWithoutUsages

      public ClassSymbolImpl copyWithoutUsages()
      Overrides:
      copyWithoutUsages in class SymbolImpl
    • superClassesFqn

      public List<String> superClassesFqn()
      Specified by:
      superClassesFqn in interface ClassSymbol
    • shouldSearchHierarchyInTypeshed

      public boolean shouldSearchHierarchyInTypeshed()
    • superClasses

      public List<Symbol> superClasses()
      Specified by:
      superClasses in interface ClassSymbol
    • addSuperClass

      public void addSuperClass(Symbol symbol)
    • hasUnresolvedTypeHierarchy

      public boolean hasUnresolvedTypeHierarchy()
      Specified by:
      hasUnresolvedTypeHierarchy in interface ClassSymbol
    • hasUnresolvedTypeHierarchy

      public boolean hasUnresolvedTypeHierarchy(boolean includeAmbiguousSymbols)
    • declaredMembers

      public Set<Symbol> declaredMembers()
      Specified by:
      declaredMembers in interface ClassSymbol
    • resolveMember

      public Optional<Symbol> resolveMember(String memberName)
      Specified by:
      resolveMember in interface ClassSymbol
    • hasMetaClass

      public boolean hasMetaClass()
      Specified by:
      hasMetaClass in interface ClassSymbol
    • canHaveMember

      public boolean canHaveMember(String memberName)
      Specified by:
      canHaveMember in interface ClassSymbol
    • hasSuperClassWithUnknownMetaClass

      public boolean hasSuperClassWithUnknownMetaClass()
    • definitionLocation

      public LocationInFile definitionLocation()
      Specified by:
      definitionLocation in interface ClassSymbol
    • isOrExtends

      public boolean isOrExtends(String fullyQualifiedClassName)
      Specified by:
      isOrExtends in interface ClassSymbol
    • isOrExtends

      public boolean isOrExtends(ClassSymbol other)
      Specified by:
      isOrExtends in interface ClassSymbol
    • canBeOrExtend

      public boolean canBeOrExtend(String fullyQualifiedClassName)
      Specified by:
      canBeOrExtend in interface ClassSymbol
    • hasDecorators

      public boolean hasDecorators()
      Specified by:
      hasDecorators in interface ClassSymbol
    • 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:
      removeUsages in class SymbolImpl
    • 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 to superClasses. This might happen in the following cases: - Super classes have been already read, hence class symbol is not lazy anymore - superClassesFqns is empty, meaning either this isn't a precomputed typeshed symbol or the class have no superclass.