Class TypeArgument


public final class TypeArgument extends HierarchicalTypeSignature
A type argument.
  • Field Details

  • Constructor Details

  • Method Details

    • getWildcard

      public TypeArgument.Wildcard getWildcard()
      Get the type wildcard, which is one of {NONE, ANY, EXTENDS, SUPER}.
      Returns:
      The type wildcard.
    • getTypeSignature

      public ReferenceTypeSignature getTypeSignature()
      Get the type signature associated with the wildcard (or null, if the wildcard is ANY).
      Returns:
      The type signature.
    • addTypeAnnotation

      protected void addTypeAnnotation(List<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
    • parse

      private static TypeArgument parse(Parser parser, String definingClassName) throws ParseException
      Parse a type argument.
      Parameters:
      parser - The parser.
      definingClassName - The name of the defining class (for resolving type variables).
      Returns:
      The parsed method type signature.
      Throws:
      ParseException - If method type signature could not be parsed.
    • parseList

      static List<TypeArgument> parseList(Parser parser, String definingClassName) throws ParseException
      Parse a list of type arguments.
      Parameters:
      parser - The parser.
      definingClassName - The name of the defining class (for resolving type variables).
      Returns:
      The list of type arguments.
      Throws:
      ParseException - If type signature could not be parsed.
    • getClassName

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

      protected ClassInfo getClassInfo()
      Description copied from class: ScanResultObject
      Get the ClassInfo object for the referenced class, or null if the referenced class was not encountered during scanning (i.e. no ClassInfo object was created for the class during scanning). N.B. even if this method returns null, ScanResultObject.loadClass() may be able to load the referenced class by name.
      Overrides:
      getClassInfo in class ScanResultObject
      Returns:
      The ClassInfo object for the referenced class.
    • setScanResult

      void setScanResult(ScanResult scanResult)
      Description copied from class: ScanResultObject
      Set ScanResult backreferences in info objects after scan has completed.
      Overrides:
      setScanResult in class HierarchicalTypeSignature
      Parameters:
      scanResult - the scan result
    • findReferencedClassNames

      public void findReferencedClassNames(Set<String> refdClassNames)
      Get the names of any classes referenced in the type signature.
      Parameters:
      refdClassNames - the referenced class names.
    • 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.