APIdia Launch Partner
Top Description Fields Methods
java.lang.classfile.constantpool

public sealed Interface ModuleEntry

extends PoolEntry
permits ModuleEntryImpl
Known Direct Implementers
jdk.internal.classfile.impl.AbstractPoolEntry.ModuleEntryImpl
Imports
java.lang.constant.ModuleDesc, jdk.internal.classfile.impl.AbstractPoolEntry

Models a CONSTANT_Module_info structure, denoting a module, in the constant pool of a class file.

The use of a ModuleEntry is modeled by a ModuleDesc. Conversions are through ConstantPoolBuilder#moduleEntry(ModuleDesc) and asSymbol().

A module entry is composite:

ModuleEntry(Utf8Entry name)
ModuleEntry(Utf8Entry name)
where name is a module name.
Since
24
Java Virtual Machine Specification
4.4.11 The CONSTANT_Module_info Structure

Field Summary

Inherited from java.lang.classfile.constantpool.PoolEntry:
TAG_CLASSTAG_DOUBLETAG_DYNAMICTAG_FIELDREFTAG_FLOATTAG_INTEGERTAG_INTERFACE_METHODREFTAG_INVOKE_DYNAMICTAG_LONGTAG_METHOD_HANDLETAG_METHOD_TYPETAG_METHODREFTAG_MODULETAG_NAME_AND_TYPETAG_PACKAGETAG_STRINGTAG_UTF8

Method Summary

Modifier and TypeMethod and Description
public ModuleDesc

Returns:

a symbolic descriptor for the module name
asSymbol
()

Returns a symbolic descriptor for the module name.

public boolean

Returns:

whether this entry describes the given module
matches
(ModuleDesc
the module descriptor
desc
)

Returns whether this entry describes the given module.

public Utf8Entry

Returns:

the name of the module
name
()

Returns the name of the module.

Inherited from java.lang.classfile.constantpool.PoolEntry:
constantPoolindextagwidth

Method Detail

asSymbolback to summary
public ModuleDesc asSymbol()

Returns a symbolic descriptor for the module name.

API Note

If only symbol equivalence is desired, matches should be used. It requires reduced parsing and can improve class file reading performance.

Returns:ModuleDesc

a symbolic descriptor for the module name

matchesback to summary
public boolean matches(ModuleDesc desc)

Returns whether this entry describes the given module.

Parameters
desc:ModuleDesc

the module descriptor

Returns:boolean

whether this entry describes the given module

Since
25
nameback to summary
public Utf8Entry name()

Returns the name of the module.

Returns:Utf8Entry

the name of the module