8334714: Implement JEP 484: Class-File API

Reviewed-by: liach, vromero
This commit is contained in:
Adam Sotona 2024-11-15 14:38:17 +00:00
parent 6cdebf0e4c
commit 84ffb64cd7
165 changed files with 312 additions and 799 deletions

View file

@ -27,27 +27,21 @@ package java.lang.classfile;
import java.util.List;
import jdk.internal.classfile.impl.SignaturesImpl;
import jdk.internal.javac.PreviewFeature;
import static java.util.Objects.requireNonNull;
/**
* Models the generic signature of a class file, as defined by JVMS {@jvms 4.7.9}.
*
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface ClassSignature
permits SignaturesImpl.ClassSignatureImpl {
/** {@return the type parameters of this class} */
List<Signature.TypeParam> typeParameters();
/**
* {@return the instantiation of the superclass in this signature}
*
* @since 23
*/
/** {@return the instantiation of the superclass in this signature} */
Signature.ClassTypeSig superclassSignature();
/** {@return the instantiation of the interfaces in this signature} */
@ -60,7 +54,6 @@ public sealed interface ClassSignature
* {@return a class signature}
* @param superclassSignature the superclass
* @param superinterfaceSignatures the interfaces
* @since 23
*/
public static ClassSignature of(Signature.ClassTypeSig superclassSignature,
Signature.ClassTypeSig... superinterfaceSignatures) {
@ -72,7 +65,6 @@ public sealed interface ClassSignature
* @param typeParameters the type parameters
* @param superclassSignature the superclass
* @param superinterfaceSignatures the interfaces
* @since 23
*/
public static ClassSignature of(List<Signature.TypeParam> typeParameters,
Signature.ClassTypeSig superclassSignature,