Class HierarchicalTypeSignature

java.lang.Object
io.github.classgraph.HierarchicalTypeSignature
Direct Known Subclasses:
ClassTypeSignature, MethodTypeSignature, TypeArgument, TypeParameter, TypeSignature

public abstract class HierarchicalTypeSignature extends Object
A Java type signature. Subclasses are ClassTypeSignature, MethodTypeSignature, and TypeSignature.
  • Field Details

    • typeAnnotationInfo

      protected AnnotationInfoList typeAnnotationInfo
    • scanResult

      protected transient ScanResult scanResult
      The scan result.
    • classRef

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

    • HierarchicalTypeSignature

      public HierarchicalTypeSignature()
  • Method Details

    • addTypeAnnotation

      protected void addTypeAnnotation(AnnotationInfo annotationInfo)
      Add a type annotation.
      Parameters:
      annotationInfo - the annotation
    • getTypeAnnotationInfo

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

      protected abstract void addTypeAnnotation(List<io.github.classgraph.Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo)
      Add a type annotation.
      Parameters:
      typePath - the type path
      annotationInfo - the annotation
    • toStringInternal

      protected abstract void toStringInternal(boolean useSimpleNames, AnnotationInfoList annotationsToExclude, StringBuilder buf)
      Render type signature to string.
      Parameters:
      useSimpleNames - whether to use simple names for classes.
      annotationsToExclude - toplevel annotations to exclude, to eliminate duplication (toplevel annotations are both class/field/method annotations and type annotations).
      buf - the StringBuilder to write to.
    • toString

      protected void toString(boolean useSimpleNames, StringBuilder buf)
      Render type signature to string.
      Parameters:
      useSimpleNames - whether to use simple names for classes.
      buf - the StringBuilder to write to.
    • findReferencedClassInfo

      protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log)
      Get ClassInfo objects for any classes referenced by this object.
      Parameters:
      classNameToClassInfo - the map from class name to ClassInfo.
      refdClassInfo - the referenced class info
      log - the log
    • 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.