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

public sealed Interface AnnotationConstantValueEntry

extends PoolEntry
permits DoubleEntry, FloatEntry, IntegerEntry, LongEntry, Utf8Entry
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.Utf8Entry
Imports
java.lang.classfile.AnnotationValue, java.lang.constant.ConstantDesc

Marker interface for constant pool entries that can represent constant values associated with elements of annotations. They are also the only entries that do not refer to other constant pool entries.

API Note

An annotation constant value entry alone is not sufficient to determine the annotation constant; for example, an IntegerEntry of 1 can mean true in AnnotationValue.OfBoolean or 1 in AnnotationValue.OfInt.

Since
24
Java Virtual Machine Specification
4.7.16.1 The element_value structure
See Also
AnnotationValue.OfConstant

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:

the constant value
constantValue
()

Returns the constant value.

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

Method Detail

constantValueback to summary
public ConstantDesc constantValue()

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

Returns:ConstantDesc

the constant value