APIdia Launch Partner
Top Description Methods
java.lang.classfile.attribute

public sealed Interface MethodParametersAttribute

extends Attribute<MethodParametersAttribute>, MethodElement
permits BoundMethodParametersAttribute, UnboundMethodParametersAttribute
Known Direct Implementers
jdk.internal.classfile.impl.BoundAttribute.BoundMethodParametersAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundMethodParametersAttribute
Imports
java.lang.classfile.Attribute, .AttributeMapper, .Attributes, .ClassFile, .MethodElement, java.lang.reflect.Executable, java.util.List, jdk.internal.classfile.impl.BoundAttribute, .UnboundAttribute

Models the MethodParameters attribute (JVMS 4.7.24), which records reflective information about this method's parameters such as access modifiers.

This attribute only appears on methods, and does not permit multiple instances in a method. It has a data dependency on the constant pool.

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

Since
24
Java Virtual Machine Specification
4.7.24 The MethodParameters Attribute
See Also
Attributes#methodParameters(), Executable#getParameters()

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

Exceptions
IllegalArgumentException:
if the number of parameters exceeds the limit of u1
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

Exceptions
IllegalArgumentException:
if the number of parameters exceeds the limit of u1
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 descriptor.

Returns:List<MethodParameterInfo>

information about the parameters of the method