Spec-Zone.ru › OpenJDK 27

Interface MethodParameterInfo

public sealed interface MethodParameterInfo
Models a single method parameter in the MethodParametersAttribute.
See Java Virtual Machine Specification:
4.7.24 The MethodParameters Attribute
Since:
24
See Also:
  • MethodParametersAttribute.parameters()
  • Parameter

Method Summary

Modifier and Type Method Description
default Set<AccessFlag> flags()
Returns the access flags, as a set of flag enums.
int flagsMask()
Returns the access flags, as a bit mask.
default boolean has(AccessFlag flag)
Returns whether the method parameter has a specific flag set.
Optional<Utf8Entry> name()
Returns the parameter name, if it has one.
static MethodParameterInfo of(Optional<Utf8Entry> name, int flags)
Returns a method parameter description.
static MethodParameterInfo of(Optional<String> name, AccessFlag... flags)
Returns a method parameter description.
static MethodParameterInfo ofParameter(Optional<String> name, int flags)
Returns a method parameter description.

Method Details

name

Optional<Utf8Entry> name()
Returns the parameter name, if it has one.
Returns:
the parameter name, if it has one
See Also:
  • Parameter.getName()
  • Parameter.isNamePresent()

flagsMask

int flagsMask()
Returns the access flags, as a bit mask. It is a u2 value.
Returns:
the access flags, as a bit mask
See Also:
  • Parameter.getModifiers()
  • AccessFlag.Location.METHOD_PARAMETER

flags

default Set<AccessFlag> flags()
Returns the access flags, as a set of flag enums.
Returns:
the access flags, as a set of flag enums
Throws:
IllegalArgumentException - if the flags mask has any undefined bit set
See Also:
  • Parameter.accessFlags()
  • AccessFlag.Location.METHOD_PARAMETER

has

default boolean has(AccessFlag flag)
Returns whether the method parameter has a specific flag set.
Parameters:
flag - the method parameter flag
Returns:
whether the method parameter has a specific flag set
See Also:
  • AccessFlag.Location.METHOD_PARAMETER

of

static MethodParameterInfo of(Optional<Utf8Entry> name, int flags)
Returns a method parameter description.
Parameters:
name - the method parameter name, may be empty
flags - the method parameter access flags
Returns:
a method parameter description
Throws:
IllegalArgumentException - if flags is not u2

of

static MethodParameterInfo of(Optional<String> name, AccessFlag... flags)
Returns a method parameter description.
Parameters:
name - the method parameter name, may be empty
flags - the method parameter access flags
Returns:
a method parameter description
Throws:
IllegalArgumentException - if any flag cannot be applied to the AccessFlag.Location.METHOD_PARAMETER location

ofParameter

static MethodParameterInfo ofParameter(Optional<String> name, int flags)
Returns a method parameter description.
Parameters:
name - the method parameter name, may be empty
flags - the method parameter access flags
Returns:
a method parameter description
Throws:
IllegalArgumentException - if flags is not u2

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2026, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API