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

public sealed Interface DynamicConstantPoolEntry

extends PoolEntry
permits ConstantDynamicEntry, InvokeDynamicEntry
Known Direct Subinterfaces
java.lang.classfile.constantpool.InvokeDynamicEntry, java.lang.classfile.constantpool.ConstantDynamicEntry
Imports
java.lang.classfile.BootstrapMethodEntry

Superinterface modeling dynamically-computed constant pool entries, which include ConstantDynamicEntry and InvokeDynamicEntry, in the constant pool of a class file.

Different types of dynamically-computed constant pool entries bear structural similarities, but they appear in distinct locations. As a result, their uses are represented by different symbolic descriptors, specific to each subtype.

A dynamic constant entry is composite:

DynamicConstantPoolEntry( BootstrapMethodEntry bootstrap, NameAndTypeEntry nameAndType )
DynamicConstantPoolEntry(
    BootstrapMethodEntry bootstrap,
    NameAndTypeEntry nameAndType
)
Since
24
Java Virtual Machine Specification
4.4.10 The CONSTANT_Dynamic_info and CONSTANT_InvokeDynamic_info Structures, 5.4.3.6 Dynamically-Computed Constant and Call Site Resolution
See Also
Dynamic resolution of call sites and constants

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 BootstrapMethodEntry

Returns:

the entry in the bootstrap method table for this constant
bootstrap
()

Returns the entry in the bootstrap method table for this constant.

public int

Returns:

index of the entry in the bootstrap method table for this constant
bootstrapMethodIndex
()

Returns index of the entry in the bootstrap method table for this constant.

public default Utf8Entry

Returns:

the name indicated by this symbolic reference
name
()

Returns the name indicated by this symbolic reference.

public NameAndTypeEntry

Returns:

the name and the descriptor string indicated by this symbolic reference
nameAndType
()

Returns the name and the descriptor string indicated by this symbolic reference.

public default Utf8Entry

Returns:

the descriptor string indicated by this symbolic reference
type
()

Returns the descriptor string indicated by this symbolic reference.

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

Method Detail

bootstrapback to summary
public BootstrapMethodEntry bootstrap()

Returns the entry in the bootstrap method table for this constant.

Returns:BootstrapMethodEntry

the entry in the bootstrap method table for this constant

See Also
Execution of bootstrap methods, ConstantPoolBuilder::constantDynamicEntry(BootstrapMethodEntry, NameAndTypeEntry), ConstantPoolBuilder::invokeDynamicEntry(BootstrapMethodEntry, NameAndTypeEntry)
bootstrapMethodIndexback to summary
public int bootstrapMethodIndex()

Returns index of the entry in the bootstrap method table for this constant. The return value is equivalent to bootstrap().bsmIndex().

Returns:int

index of the entry in the bootstrap method table for this constant

nameback to summary
public default Utf8Entry name()

Returns the name indicated by this symbolic reference.

Returns:Utf8Entry

the name indicated by this symbolic reference

nameAndTypeback to summary
public NameAndTypeEntry nameAndType()

Returns the name and the descriptor string indicated by this symbolic reference.

Returns:NameAndTypeEntry

the name and the descriptor string indicated by this symbolic reference

See Also
Execution of bootstrap methods, ConstantPoolBuilder::constantDynamicEntry(BootstrapMethodEntry, NameAndTypeEntry), ConstantPoolBuilder::invokeDynamicEntry(BootstrapMethodEntry, NameAndTypeEntry)
typeback to summary
public default Utf8Entry type()

Returns the descriptor string indicated by this symbolic reference. This is a field descriptor string if this entry is a ConstantDynamicEntry, or a method descriptor string if this entry is a InvokeDynamicEntry.

API Note

Each subinterface has its specific accessor named typeSymbol for the symbolic descriptor derived from this descriptor string.

Returns:Utf8Entry

the descriptor string indicated by this symbolic reference