APIdia Launch Partner
Top Description Methods
java.lang.classfile

public sealed Interface ClassSignature

permits ClassSignatureImpl
Known Direct Implementers
jdk.internal.classfile.impl.SignaturesImpl.ClassSignatureImpl
Imports
java.lang.classfile.attribute.SignatureAttribute, java.util.List, jdk.internal.classfile.impl.SignaturesImpl

Models the generic signature of a class or interface, as defined by JVMS 4.7.9.1.
Since
24
Java Language Specification
8.1 Class Declarations, 9.1 Interface Declarations
Java Virtual Machine Specification
4.7.9.1 Signatures
See Also
Class, SignatureAttribute

Method Summary

Modifier and TypeMethod and Description
public static ClassSignature

Returns:

a class signature with no type parameter declaration
of
(Signature.ClassTypeSig
the superclass
superclassSignature
,
Signature.ClassTypeSig...
the interfaces
superinterfaceSignatures
)

Returns a class signature with no type parameter declaration.

public static ClassSignature

Returns:

a class signature
of
(List<Signature.TypeParam>
the type parameters, may be empty
typeParameters
,
Signature.ClassTypeSig
the superclass
superclassSignature
,
Signature.ClassTypeSig...
the interfaces
superinterfaceSignatures
)

Returns a class signature.

public static ClassSignature

Returns:

class signature
parseFrom
(String
the raw class signature string
classSignature
)

Parses a raw class signature string into a Signature.

public String

Returns:

the raw signature string
signatureString
()

Returns the raw signature string.

public Signature.ClassTypeSig

Returns:

the instantiation of the superclass in this signature
superclassSignature
()

Returns the instantiation of the superclass in this signature.

public List<Signature.ClassTypeSig>

Returns:

the instantiation of the interfaces in this signature, may be empty
superinterfaceSignatures
()

Returns the instantiation of the interfaces in this signature, may be empty.

public List<Signature.TypeParam>

Returns:

the type parameters of this class or interface, may be empty
typeParameters
()

Returns the type parameters of this class or interface, may be empty.

Method Detail

ofback to summary
public static ClassSignature of(Signature.ClassTypeSig superclassSignature, Signature.ClassTypeSig... superinterfaceSignatures)

Returns a class signature with no type parameter declaration.

Parameters
superclassSignature:Signature.ClassTypeSig

the superclass

superinterfaceSignatures:Signature.ClassTypeSig[]

the interfaces

Returns:ClassSignature

a class signature with no type parameter declaration

ofback to summary
public static ClassSignature of(List<Signature.TypeParam> typeParameters, Signature.ClassTypeSig superclassSignature, Signature.ClassTypeSig... superinterfaceSignatures)

Returns a class signature.

Parameters
typeParameters:List<Signature.TypeParam>

the type parameters, may be empty

superclassSignature:Signature.ClassTypeSig

the superclass

superinterfaceSignatures:Signature.ClassTypeSig[]

the interfaces

Returns:ClassSignature

a class signature

parseFromback to summary
public static ClassSignature parseFrom(String classSignature)

Parses a raw class signature string into a Signature.

Parameters
classSignature:String

the raw class signature string

Returns:ClassSignature

class signature

Exceptions
IllegalArgumentException:
if the string is not a valid class signature string
signatureStringback to summary
public String signatureString()

Returns the raw signature string.

Returns:String

the raw signature string

superclassSignatureback to summary
public Signature.ClassTypeSig superclassSignature()

Returns the instantiation of the superclass in this signature. Interfaces return a signature representing the Object class.

Returns:Signature.ClassTypeSig

the instantiation of the superclass in this signature

Java Language Specification
8.1.4 Superclasses and Subclasses
See Also
Class#getGenericSuperclass()
superinterfaceSignaturesback to summary
public List<Signature.ClassTypeSig> superinterfaceSignatures()

Returns the instantiation of the interfaces in this signature, may be empty.

Returns:List<Signature.ClassTypeSig>

the instantiation of the interfaces in this signature, may be empty

Java Language Specification
8.1.5 Superinterfaces, 9.1.3 Superinterfaces and Subinterfaces
See Also
Class#getGenericInterfaces()
typeParametersback to summary
public List<Signature.TypeParam> typeParameters()

Returns the type parameters of this class or interface, may be empty.

Returns:List<Signature.TypeParam>

the type parameters of this class or interface, may be empty

Java Language Specification
8.1.2 Generic Classes and Type Parameters, 9.1.2 Generic Interfaces and Type Parameters
See Also
Class#getTypeParameters()