Interface MethodSignature
public sealed interface MethodSignature
MethodSignature is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the generic signature of a method, as defined by JVMS 4.7.9.
- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionReturns the signatures of the parameters of this method.static MethodSignaturePREVIEWReturns a method signature.static MethodSignaturePREVIEWof(MethodTypeDesc methodDescriptor) Returns a method signature for a raw (no generic information) method descriptor.static MethodSignaturePREVIEWof(List<Signature.TypeParamPREVIEW> typeParameters, List<Signature.ThrowableSigPREVIEW> exceptions, SignaturePREVIEW result, SignaturePREVIEW... arguments) Returns a method signature.static MethodSignaturePREVIEWParses a raw method signature string into a MethodSignatureresult()Returns the signatures of the return value of this method.Returns the raw signature string.Returns the signatures of the exceptions thrown by this method.Returns the type parameters of this method.
-
Method Details
-
typeParameters
List<Signature.TypeParamPREVIEW> typeParameters()Returns the type parameters of this method.- Returns:
- the type parameters of this method
-
arguments
-
result
-
throwableSignatures
List<Signature.ThrowableSigPREVIEW> throwableSignatures()Returns the signatures of the exceptions thrown by this method.- Returns:
- the signatures of the exceptions thrown by this method
-
signatureString
-
of
Returns a method signature for a raw (no generic information) method descriptor.- Parameters:
methodDescriptor- the method descriptor- Returns:
- a method signature for a raw (no generic information) method descriptor
-
of
-
of
static MethodSignaturePREVIEW of(List<Signature.TypeParamPREVIEW> typeParameters, List<Signature.ThrowableSigPREVIEW> exceptions, SignaturePREVIEW result, SignaturePREVIEW... arguments) Returns a method signature.- Parameters:
typeParameters- signatures for the type parametersexceptions- signatures for the exceptionsresult- signature for the return typearguments- signatures for the method arguments- Returns:
- a method signature
-
parseFrom
Parses a raw method signature string into a MethodSignature- Parameters:
methodSignature- the raw method signature string- Returns:
- method signature
-
MethodSignaturewhen preview features are enabled.