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

public sealed Interface LoadableConstantEntry

extends PoolEntry
permits ClassEntry, ConstantDynamicEntry, ConstantValueEntry, MethodHandleEntry, MethodTypeEntry
Known Direct Subinterfaces
java.lang.classfile.constantpool.MethodHandleEntry, java.lang.classfile.constantpool.MethodTypeEntry, java.lang.classfile.constantpool.ClassEntry, java.lang.classfile.constantpool.ConstantDynamicEntry, java.lang.classfile.constantpool.ConstantValueEntry
Imports
java.lang.classfile.CodeBuilder, .Opcode, .TypeKind, java.lang.classfile.instruction.ConstantInstruction, java.lang.constant.ConstantDesc

Marker interface for constant pool entries suitable for loading via the ldc instructions.

The use of a LoadableConstantEntry is modeled by a ConstantDesc. Conversions are through ConstantPoolBuilder#loadableConstantEntry(ConstantDesc) and constantValue().

Since
24
Java Virtual Machine Specification
4.4 The Constant Pool
See Also
CodeBuilder#ldc(LoadableConstantEntry)

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 ConstantDesc

Returns:

a symbolic descriptor of this constant
constantValue
()

Returns a symbolic descriptor of this constant.

public default TypeKind

Returns:

the data type of this constant
typeKind
()

Returns the data type of this constant.

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

Method Detail

constantValueback to summary
public ConstantDesc constantValue()

Returns a symbolic descriptor of this constant.

Returns:ConstantDesc

a symbolic descriptor of this constant

See Also
ConstantPoolBuilder#loadableConstantEntry(ConstantDesc)
typeKindback to summary
public default TypeKind typeKind()

Returns the data type of this constant.

If the data type is of category 2, this constant must be loaded with ldc2_w; otherwise, the data type is of category 1, and this constant must be loaded with ldc or ldc_w.

Returns:TypeKind

the data type of this constant