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 4.7.9.
- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionReturns the signatures of the parameters of this method.static MethodSignaturePREVIEW
Returns a method signature.static MethodSignaturePREVIEW
of
(MethodTypeDesc methodDescriptor) Returns a method signature for a raw (no generic information) method descriptor.static MethodSignaturePREVIEW
of
(List<Signature.TypeParamPREVIEW> typeParameters, List<Signature.ThrowableSigPREVIEW> exceptions, SignaturePREVIEW result, SignaturePREVIEW... arguments) Returns a method signature.static MethodSignaturePREVIEW
Parses a raw method signature string into a MethodSignaturePREVIEWresult()
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 MethodSignaturePREVIEW- Parameters:
methodSignature
- the raw method signature string- Returns:
- method signature
-
MethodSignature
when preview features are enabled.