Top Description Methods
java.lang.classfile.attribute

public sealed Interface MethodParametersAttribute

extends Attribute<MethodParametersAttribute>, MethodElement
Known Direct Implementers
jdk.internal.classfile.impl.BoundAttribute.BoundMethodParametersAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundMethodParametersAttribute
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.util.List, java.lang.classfile.Attribute, .MethodElement, jdk.internal.classfile.impl.BoundAttribute, .UnboundAttribute, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use MethodParametersAttribute 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 MethodParameters attribute 4.7.24, which can appear on methods, and records optional information about the method's parameters. Delivered as a java.lang.classfile.MethodElement when traversing the elements of a java.lang.classfile.MethodModel.

The attribute does not permit multiple instances in a given location. Subsequent occurrence of the attribute takes precedence during the attributed element build or transformation.

The attribute was introduced in the Java SE Platform version 8.

Since
22

Method Summary

Modifier and TypeMethod and Description
public static MethodParametersAttribute

Returns:

a MethodParameters attribute
of
(List<MethodParameterInfo>
the method parameter descriptions
parameters
)

Returns a MethodParameters attribute.

public static MethodParametersAttribute

Returns:

a MethodParameters attribute
of
(MethodParameterInfo...
the method parameter descriptions
parameters
)

Returns a MethodParameters attribute.

public List<MethodParameterInfo>

Returns:

information about the parameters of the method
parameters
()

Returns information about the parameters of the method.

Inherited from java.lang.classfile.Attribute:
attributeMapperattributeName

Method Detail

ofback to summary
public static MethodParametersAttribute of(List<MethodParameterInfo> parameters)

Returns a MethodParameters attribute.

Parameters
parameters:List<MethodParameterInfo>

the method parameter descriptions

Returns:MethodParametersAttribute

a MethodParameters attribute

ofback to summary
public static MethodParametersAttribute of(MethodParameterInfo... parameters)

Returns a MethodParameters attribute.

Parameters
parameters:MethodParameterInfo[]

the method parameter descriptions

Returns:MethodParametersAttribute

a MethodParameters attribute

parametersback to summary
public List<MethodParameterInfo> parameters()

Returns information about the parameters of the method. The i'th entry in the list corresponds to the i'th parameter in the method declaration.

Returns:List<MethodParameterInfo>

information about the parameters of the method