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

public sealed Interface MethodParameterInfo

permits UnboundMethodParameterInfo
Known Direct Implementers
jdk.internal.classfile.impl.UnboundAttribute.UnboundMethodParameterInfo
Imports
java.lang.classfile.constantpool.Utf8Entry, java.lang.reflect.AccessFlag, .Parameter, java.util.Optional, .Set, jdk.internal.classfile.impl.TemporaryConstantPool, .UnboundAttribute, .Util

Models a single method parameter in the MethodParametersAttribute.
Since
24
Java Virtual Machine Specification
4.7.24 The MethodParameters Attribute
See Also
MethodParametersAttribute#parameters(), Parameter

Method Summary

Modifier and TypeMethod and Description
public default Set<AccessFlag>

Returns:

the access flags, as a set of flag enums
flags
()

Returns the access flags, as a set of flag enums.

public int

Returns:

the access flags, as a bit mask
flagsMask
()

Returns the access flags, as a bit mask.

public default boolean

Returns:

whether the method parameter has a specific flag set
has
(AccessFlag
the method parameter flag
flag
)

Returns whether the method parameter has a specific flag set.

public Optional<Utf8Entry>

Returns:

the parameter name, if it has one
name
()

Returns the parameter name, if it has one.

public static MethodParameterInfo

Returns:

a method parameter description
of
(Optional<Utf8Entry>
the method parameter name, may be empty
name
,
int
the method parameter access flags
flags
)

Returns a method parameter description.

public static MethodParameterInfo

Returns:

a method parameter description
of
(Optional<String>
the method parameter name, may be empty
name
,
AccessFlag...
the method parameter access flags
flags
)

Returns a method parameter description.

public static MethodParameterInfo

Returns:

a method parameter description
ofParameter
(Optional<String>
the method parameter name, may be empty
name
,
int
the method parameter access flags
flags
)

Returns a method parameter description.

Method Detail

flagsback to summary
public default Set<AccessFlag> flags()

Returns the access flags, as a set of flag enums.

Returns:Set<AccessFlag>

the access flags, as a set of flag enums

Exceptions
IllegalArgumentException:
if the flags mask has any undefined bit set
See Also
Parameter#accessFlags(), AccessFlag.Location#METHOD_PARAMETER
flagsMaskback to summary
public int flagsMask()

Returns the access flags, as a bit mask. It is a u2 value.

Returns:int

the access flags, as a bit mask

See Also
Parameter#getModifiers(), AccessFlag.Location#METHOD_PARAMETER
hasback to summary
public default boolean has(AccessFlag flag)

Returns whether the method parameter has a specific flag set.

Parameters
flag:AccessFlag

the method parameter flag

Returns:boolean

whether the method parameter has a specific flag set

See Also
AccessFlag.Location#METHOD_PARAMETER
nameback to summary
public Optional<Utf8Entry> name()

Returns the parameter name, if it has one.

Returns:Optional<Utf8Entry>

the parameter name, if it has one

See Also
Parameter#getName(), Parameter#isNamePresent()
ofback to summary
public static MethodParameterInfo of(Optional<Utf8Entry> name, int flags)

Returns a method parameter description.

Parameters
name:Optional<Utf8Entry>

the method parameter name, may be empty

flags:int

the method parameter access flags

Returns:MethodParameterInfo

a method parameter description

Exceptions
IllegalArgumentException:
if flags is not u2
ofback to summary
public static MethodParameterInfo of(Optional<String> name, AccessFlag... flags)

Returns a method parameter description.

Parameters
name:Optional<String>

the method parameter name, may be empty

flags:AccessFlag[]

the method parameter access flags

Returns:MethodParameterInfo

a method parameter description

Exceptions
IllegalArgumentException:
if any flag cannot be applied to the AccessFlag.Location#METHOD_PARAMETER location
ofParameterback to summary
public static MethodParameterInfo ofParameter(Optional<String> name, int flags)

Returns a method parameter description.

Parameters
name:Optional<String>

the method parameter name, may be empty

flags:int

the method parameter access flags

Returns:MethodParameterInfo

a method parameter description

Exceptions
IllegalArgumentException:
if flags is not u2