Preview
Second Preview of ClassFile API (JEP 466).
Programs can only use ModuleResolutionAttribute
when preview features are enabled.
Preview features may be removed in a future release,
or upgraded to permanent features of the Java platform.
ModuleResolution
attribute, which can
appear on classes that represent module descriptors. This is a JDK-specific
* attribute, which captures resolution metadata for modules.
Delivered as a java.lang.classfile.ClassElement
when
traversing the elements of a java.lang.classfile.ClassModel
.
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)
}
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.
Modifier and Type | Method and Description |
---|---|
public static ModuleResolutionAttribute | Returns: aModuleResolution attributethe resolution flags resolutionFlags)Returns a |
public int | Returns: the module resolution flagsThe value of the resolution_flags item is a mask of flags used to denote properties of module resolution. |
of | back to summary |
---|---|
public static ModuleResolutionAttribute of(int resolutionFlags) Returns a
|
resolutionFlags | back to summary |
---|---|
public int resolutionFlags() The value of the resolution_flags item is a mask of flags used to denote properties of module resolution. The flags are as follows:
|