Top Description Methods
java.lang.classfile.constantpool

public sealed Interface ConstantValueEntry

extends LoadableConstantEntry
Known Direct Subinterfaces
java.lang.classfile.constantpool.DoubleEntry, java.lang.classfile.constantpool.FloatEntry, java.lang.classfile.constantpool.IntegerEntry, java.lang.classfile.constantpool.LongEntry, java.lang.classfile.constantpool.StringEntry
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.lang.constant.ConstantDesc, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use ConstantValueEntry when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.

Models a constant pool entry that can be used as the constant in a ConstantValue attribute; this includes the four primitive constant types and String constants.
Since
22

Method Summary

Modifier and TypeMethod and Description
public ConstantDesc

Returns:

the constant value
constantValue
()

Redeclares java.lang.classfile.constantpool.LoadableConstantEntry.constantValue.

Returns the constant value.

Inherited from java.lang.classfile.constantpool.LoadableConstantEntry:
typeKind

Method Detail

constantValueback to summary
public ConstantDesc constantValue()

Redeclares java.lang.classfile.constantpool.LoadableConstantEntry.constantValue.

Returns the constant value. The constant value will be an Integer, Long, Float, Double, or String.

Returns:ConstantDesc

the constant value

Annotations
@Override