Spec-Zone.ru › OpenJDK 27

Interface ModuleResolutionAttribute

All Superinterfaces:
Attribute<ModuleResolutionAttribute>, ClassElement, ClassFileElement
public sealed interface ModuleResolutionAttribute extends Attribute<ModuleResolutionAttribute>, ClassElement
Models the ModuleResolution attribute, which can appear on classes that represent module descriptors, to capture resolution metadata for modules.

The specification of the ModuleResolution attribute is:

 ModuleResolution_attribute {
   u2 attribute_name_index;    // "ModuleResolution"
   u4 attribute_length;        // 2
   u2 resolution_flags;

 The value of the resolution_flags item is a mask of flags used to denote
 properties of module resolution. The flags are as follows:

  // Optional
  0x0001 (DO_NOT_RESOLVE_BY_DEFAULT)

  // At most one of:
  0x0002 (WARN_DEPRECATED)
  0x0004 (WARN_DEPRECATED_FOR_REMOVAL)
  0x0008 (WARN_INCUBATING)
 }
 

This attribute only appears on classes, and does not permit multiple instances in a class. It has no data dependency.

This attribute is not predefined in the Java SE Platform. This is a JDK-specific nonstandard attribute produced by the jdk.jlink module, which defines the jlink and jmod tools.

Since:
24
See Also:
  • Attributes.moduleResolution()
  • ModuleHashesAttribute
  • ModuleTargetAttribute

Method Summary

Modifier and Type Method Description
static ModuleResolutionAttribute of(int resolutionFlags)
Returns a ModuleResolution attribute.
int resolutionFlags()
Returns the module resolution flags.

Methods declared in interface Attribute

attributeMapper, attributeName
Modifier and Type Method Description
AttributeMapper<ModuleResolutionAttribute> attributeMapper()
Returns the AttributeMapper associated with this attribute.
Utf8Entry attributeName()
Returns the name of the attribute.

Method Details

resolutionFlags

int resolutionFlags()
Returns the module resolution flags. It is a u2 value.

The value of the resolution_flags item is a mask of flags used to denote properties of module resolution. The flags are as follows:

  // Optional
  0x0001 (DO_NOT_RESOLVE_BY_DEFAULT)

  // At most one of:
  0x0002 (WARN_DEPRECATED)
  0x0004 (WARN_DEPRECATED_FOR_REMOVAL)
  0x0008 (WARN_INCUBATING)
  
Returns:
the module resolution flags

of

static ModuleResolutionAttribute of(int resolutionFlags)
Returns a ModuleResolution attribute.
Parameters:
resolutionFlags - the resolution flags
Returns:
a ModuleResolution attribute
Throws:
IllegalArgumentException - if resolutionFlags 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