Top Description Methods
java.lang.classfile

public sealed Interface MethodSignature

Known Direct Implementers
jdk.internal.classfile.impl.SignaturesImpl.MethodSignatureImpl
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.lang.constant.MethodTypeDesc, java.util.List, jdk.internal.classfile.impl.SignaturesImpl, .Util, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use MethodSignature when preview features are enabled.
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 TypeMethod and Description
public List<Signature>

Returns:

the signatures of the parameters of this method
arguments
()

Returns the signatures of the parameters of this method.

public static MethodSignature

Returns:

a method signature for a raw (no generic information) method descriptor
of
(MethodTypeDesc
the method descriptor
methodDescriptor
)

Returns a method signature for a raw (no generic information) method descriptor.

public static MethodSignature

Returns:

a method signature
of
(Signature
signature for the return type
result
,
Signature...
signatures for the method arguments
arguments
)

Returns a method signature.

public static MethodSignature

Returns:

a method signature
of
(List<Signature.TypeParam>
signatures for the type parameters
typeParameters
,
List<Signature.ThrowableSig>
signatures for the exceptions
exceptions
,
Signature
signature for the return type
result
,
Signature...
signatures for the method arguments
arguments
)

Returns a method signature.

public static MethodSignature

Returns:

method signature
parseFrom
(String
the raw method signature string
methodSignature
)

Parses a raw method signature string into a MethodSignature

public Signature

Returns:

the signatures of the return value of this method
result
()

Returns the signatures of the return value of this method.

public String

Returns:

the raw signature string
signatureString
()

Returns the raw signature string.

public List<Signature.ThrowableSig>

Returns:

the signatures of the exceptions thrown by this method
throwableSignatures
()

Returns the signatures of the exceptions thrown by this method.

public List<Signature.TypeParam>

Returns:

the type parameters of this method
typeParameters
()

Returns the type parameters of this method.

Method Detail

argumentsback to summary
public List<Signature> arguments()

Returns the signatures of the parameters of this method.

Returns:List<Signature>

the signatures of the parameters of this method

ofback to summary
public static MethodSignature of(MethodTypeDesc methodDescriptor)

Returns a method signature for a raw (no generic information) method descriptor.

Parameters
methodDescriptor:MethodTypeDesc

the method descriptor

Returns:MethodSignature

a method signature for a raw (no generic information) method descriptor

ofback to summary
public static MethodSignature of(Signature result, Signature... arguments)

Returns a method signature.

Parameters
result:Signature

signature for the return type

arguments:Signature[]

signatures for the method arguments

Returns:MethodSignature

a method signature

ofback to summary
public static MethodSignature of(List<Signature.TypeParam> typeParameters, List<Signature.ThrowableSig> exceptions, Signature result, Signature... arguments)

Returns a method signature.

Parameters
typeParameters:List<Signature.TypeParam>

signatures for the type parameters

exceptions:List<Signature.ThrowableSig>

signatures for the exceptions

result:Signature

signature for the return type

arguments:Signature[]

signatures for the method arguments

Returns:MethodSignature

a method signature

parseFromback to summary
public static MethodSignature parseFrom(String methodSignature)

Parses a raw method signature string into a MethodSignature

Parameters
methodSignature:String

the raw method signature string

Returns:MethodSignature

method signature

resultback to summary
public Signature result()

Returns the signatures of the return value of this method.

Returns:Signature

the signatures of the return value of this method

signatureStringback to summary
public String signatureString()

Returns the raw signature string.

Returns:String

the raw signature string

throwableSignaturesback to summary
public List<Signature.ThrowableSig> throwableSignatures()

Returns the signatures of the exceptions thrown by this method.

Returns:List<Signature.ThrowableSig>

the signatures of the exceptions thrown by this method

typeParametersback to summary
public List<Signature.TypeParam> typeParameters()

Returns the type parameters of this method.

Returns:List<Signature.TypeParam>

the type parameters of this method