Interface ClassSignature
public sealed interface ClassSignature
Models the generic signature of a class or interface, as defined by JVMS §4.7.9.1.
- See Java Language Specification:
- 8.1 Class Declarations
9.1 Interface Declarations
- See Java Virtual Machine Specification:
- 4.7.9.1 Signatures
- Since:
- 24
- See Also:
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
static ClassSignature |
of |
Returns a class signature with no type parameter declaration. |
static ClassSignature |
of |
Returns a class signature. |
static ClassSignature |
parseFrom |
Parses a raw class signature string into a Signature. |
String |
signatureString() |
Returns the raw signature string. |
Signature.ClassTypeSig |
superclassSignature() |
Returns the instantiation of the superclass in this signature. |
List |
superinterfaceSignatures() |
Returns the instantiation of the interfaces in this signature, may be empty. |
List |
typeParameters() |
Returns the type parameters of this class or interface, may be empty. |
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 Java Language Specification:
- 8.1.2 Generic Classes and Type Parameters
9.1.2 Generic Interfaces and Type Parameters
- 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 Java Language Specification:
- 8.1.4 Superclasses and Subclasses
- 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 Java Language Specification:
- 8.1.5 Superinterfaces
9.1.3 Superinterfaces and Subinterfaces
- 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
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.