Class MethodTypeSignature

java.lang.Object
io.github.classgraph.HierarchicalTypeSignature
io.github.classgraph.MethodTypeSignature

public final class MethodTypeSignature extends HierarchicalTypeSignature
A method type signature (called "MethodSignature" in the classfile documentation).
  • Field Details

    • scanResult

      protected transient ScanResult scanResult
      The scan result.
    • classRef

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

    • getTypeParameters

      public List<TypeParameter> getTypeParameters()
      Get the type parameters for the method, if this is a generic method.
      Returns:
      The type parameters for the method, if any, otherwise null.
    • getResultType

      public TypeSignature getResultType()
      Get the result type for the method.
      Returns:
      The result type for the method, as a TypeSignature parsed type object.
    • getThrowsSignatures

      public List<ClassRefOrTypeVariableSignature> getThrowsSignatures()
      Get the throws type(s) for the method.
      Returns:
      The throws types for the method, as TypeSignature parsed type objects.
    • addTypeAnnotation

      protected void addTypeAnnotation(List<io.github.classgraph.Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo)
      Description copied from class: HierarchicalTypeSignature
      Add a type annotation.
      Specified by:
      addTypeAnnotation in class HierarchicalTypeSignature
      Parameters:
      typePath - the type path
      annotationInfo - the annotation
    • getReceiverTypeAnnotationInfo

      public AnnotationInfoList getReceiverTypeAnnotationInfo()
      Get type annotations on the explicit receiver parameter, or null if none.
      Returns:
      type annotations on the explicit receiver parameter, or null if none.
    • getClassName

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

      protected ClassInfo getClassInfo()
    • 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 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 descriptor or type signature.
      Parameters:
      classNameToClassInfo - the map from class name to ClassInfo.
      refdClassInfo - the referenced class info
      log - the log
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toStringInternal

      protected void toStringInternal(boolean useSimpleNames, AnnotationInfoList annotationsToExclude, StringBuilder buf)
      Description copied from class: HierarchicalTypeSignature
      Render type signature to string.
      Specified by:
      toStringInternal in class HierarchicalTypeSignature
      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.
    • 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.