Class TypeSignature

Direct Known Subclasses:
BaseTypeSignature, ReferenceTypeSignature

public abstract class TypeSignature extends HierarchicalTypeSignature
A type signature for a reference type or base type. Subclasses are ReferenceTypeSignature (whose own subclasses are ClassRefTypeSignature, TypeVariableSignature, and ArrayTypeSignature), and BaseTypeSignature.
  • Field Details

    • scanResult

      protected transient ScanResult scanResult
      The scan result.
    • classRef

      protected transient Class<?> classRef
      The class ref, once the class is loaded.
  • Constructor Details

    • TypeSignature

      protected TypeSignature()
      Constructor.
  • Method Details

    • findReferencedClassNames

      protected void findReferencedClassNames(Set<String> refdClassNames)
      Get the names of any classes referenced in the type signature.
      Parameters:
      refdClassNames - the referenced class names.
    • findReferencedClassInfo

      protected final void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log)
      Get ClassInfo objects for any classes referenced in the type signature.
      Parameters:
      classNameToClassInfo - the map from class name to ClassInfo.
      refdClassInfo - the referenced class info.
      log - the log
    • getTypeAnnotationInfo

      public AnnotationInfoList getTypeAnnotationInfo()
      Get a list of AnnotationInfo objects for any type annotations on this type, or null if none.
      Overrides:
      getTypeAnnotationInfo in class HierarchicalTypeSignature
      Returns:
      a list of AnnotationInfo objects for any type annotations on this type, or null if none.
    • equalsIgnoringTypeParams

      public abstract boolean equalsIgnoringTypeParams(TypeSignature other)
      Compare base types, ignoring generic type parameters.
      Parameters:
      other - the other TypeSignature to compare to.
      Returns:
      True if the two TypeSignature objects are equal, ignoring type parameters.
    • addTypeAnnotation

      protected abstract void addTypeAnnotation(List<io.github.classgraph.Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo)
      Add a type annotation to this type.
      Specified by:
      addTypeAnnotation in class HierarchicalTypeSignature
      Parameters:
      typePath - The type path.
      annotationInfo - The annotation to add.
    • getClassName

      protected abstract String getClassName()
      The name of the class (used by ScanResultObject.getClassInfo() to fetch the ClassInfo object for the class).
      Returns:
      The class name.
    • toStringWithSimpleNames

      public String toStringWithSimpleNames()
      Render to string, using only simple names for classes.
      Returns:
      the string representation, using simple names for classes.
    • toString

      public String toString()
      Render to string.
      Overrides:
      toString in class Object
      Returns:
      the string representation.