Interface ClassSignature


public sealed interface ClassSignature
Models the generic signature of a class or interface, as defined by JVMS .
Since:
24
See Also:
  • Method Details

    • typeParameters

      List<Signature.TypeParam> typeParameters()
      Returns the type parameters of this class or interface, may be empty.
      Returns:
      the type parameters of this class or interface, may be empty
      See Also:
    • superclassSignature

      Signature.ClassTypeSig superclassSignature()
      Returns the instantiation of the superclass in this signature. Interfaces return a signature representing the Object class.
      Returns:
      the instantiation of the superclass in this signature
      See Also:
    • superinterfaceSignatures

      List<Signature.ClassTypeSig> superinterfaceSignatures()
      Returns the instantiation of the interfaces in this signature, may be empty.
      Returns:
      the instantiation of the interfaces in this signature, may be empty
      See Also:
    • signatureString

      String signatureString()
      Returns the raw signature string.
      Returns:
      the raw signature string
    • of

      static ClassSignature of(Signature.ClassTypeSig superclassSignature, Signature.ClassTypeSig... superinterfaceSignatures)
      Returns a class signature with no type parameter declaration.
      Parameters:
      superclassSignature - the superclass
      superinterfaceSignatures - the interfaces
      Returns:
      a class signature with no type parameter declaration
    • of

      static ClassSignature of(List<Signature.TypeParam> typeParameters, Signature.ClassTypeSig superclassSignature, Signature.ClassTypeSig... superinterfaceSignatures)
      Returns a class signature.
      Parameters:
      typeParameters - the type parameters, may be empty
      superclassSignature - the superclass
      superinterfaceSignatures - the interfaces
      Returns:
      a class signature
    • parseFrom

      static ClassSignature parseFrom(String classSignature)
      Parses a raw class signature string into a Signature.
      Parameters:
      classSignature - the raw class signature string
      Returns:
      class signature
      Throws:
      IllegalArgumentException - if the string is not a valid class signature string