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

public sealed Interface AnnotationValue

permits OfAnnotation, OfArray, OfConstant, OfClass, OfEnum
Known Direct Subinterfaces
java.lang.classfile.AnnotationValue.OfAnnotation, java.lang.classfile.AnnotationValue.OfArray, java.lang.classfile.AnnotationValue.OfConstant, java.lang.classfile.AnnotationValue.OfClass, java.lang.classfile.AnnotationValue.OfEnum
Imports
java.lang.classfile.constantpool.*, java.lang.constant.ClassDesc, .Constable, java.util.ArrayList, .List, jdk.internal.classfile.impl.AnnotationImpl, .TemporaryConstantPool, .Util

Models an element_value structure, or a value of an element-value pair of an annotation, as defined in JVMS 4.7.16.1.

Two AnnotationValue objects should be compared using the equals method.

Since
24
See Also
Annotation, AnnotationElement, Annotations in core reflection

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
AnnotationValue.OfAnnotation

Models an annotation value of an element-value pair.

public static interface
AnnotationValue.OfArray

Models an array value of an element-value pair.

public static interface
AnnotationValue.OfBoolean

Models a boolean value of an element-value pair.

public static interface
AnnotationValue.OfByte

Models a byte value of an element-value pair.

public static interface
AnnotationValue.OfChar

Models a char value of an element-value pair.

public static interface
AnnotationValue.OfClass

Models a class value of an element-value pair.

public static interface
AnnotationValue.OfConstant

Models a constant value of an element-value pair.

public static interface
AnnotationValue.OfDouble

Models a double value of an element-value pair.

public static interface
AnnotationValue.OfEnum

Models an enum value of an element-value pair.

public static interface
AnnotationValue.OfFloat

Models a float value of an element-value pair.

public static interface
AnnotationValue.OfInt

Models an int value of an element-value pair.

public static interface
AnnotationValue.OfLong

Models a long value of an element-value pair.

public static interface
AnnotationValue.OfShort

Models a short value of an element-value pair.

public static interface
AnnotationValue.OfString

Models a string value of an element-value pair.

Field Summary

Modifier and TypeField and Description
public static final int
TAG_ANNOTATION

The tag indicating the value of an element-value pair is OfAnnotation.

public static final int
TAG_ARRAY

The tag indicating the value of an element-value pair is OfArray.

public static final int
TAG_BOOLEAN

The tag indicating the value of an element-value pair is OfBoolean.

public static final int
TAG_BYTE

The tag indicating the value of an element-value pair is OfByte.

public static final int
TAG_CHAR

The tag indicating the value of an element-value pair is OfChar.

public static final int
TAG_CLASS

The tag indicating the value of an element-value pair is OfClass.

public static final int
TAG_DOUBLE

The tag indicating the value of an element-value pair is OfDouble.

public static final int
TAG_ENUM

The tag indicating the value of an element-value pair is OfEnum.

public static final int
TAG_FLOAT

The tag indicating the value of an element-value pair is OfFloat.

public static final int
TAG_INT

The tag indicating the value of an element-value pair is OfInt.

public static final int
TAG_LONG

The tag indicating the value of an element-value pair is OfLong.

public static final int
TAG_SHORT

The tag indicating the value of an element-value pair is OfShort.

public static final int
TAG_STRING

The tag indicating the value of an element-value pair is OfString.

Method Summary

Modifier and TypeMethod and Description
public static AnnotationValue

Returns:

an annotation element
of
(Object
the annotation value
value
)

Returns an annotation element.

public static AnnotationValue.OfAnnotation

Returns:

an annotation value for an element-value pair
ofAnnotation
(Annotation
the annotation
value
)

Returns an annotation value for an element-value pair.

public static AnnotationValue.OfArray

Returns:

an array value for an element-value pair
ofArray
(List<AnnotationValue>
the array elements
values
)

Returns an array value for an element-value pair.

public static AnnotationValue.OfArray

Returns:

an array value for an element-value pair
ofArray
(AnnotationValue...
the array elements
values
)

Returns an array value for an element-value pair.

public static AnnotationValue.OfBoolean

Returns:

a boolean value for an element-value pair
ofBoolean
(IntegerEntry
the boolean value
value
)

Returns a boolean value for an element-value pair.

public static AnnotationValue.OfBoolean

Returns:

a boolean value for an element-value pair
ofBoolean
(boolean
the boolean value
value
)

Returns a boolean value for an element-value pair.

public static AnnotationValue.OfByte

Returns:

a byte value for an element-value pair
ofByte
(IntegerEntry
the byte value
value
)

Returns a byte value for an element-value pair.

public static AnnotationValue.OfByte

Returns:

a byte value for an element-value pair
ofByte
(byte
the byte value
value
)

Returns a byte value for an element-value pair.

public static AnnotationValue.OfChar

Returns:

a char value for an element-value pair
ofChar
(IntegerEntry
the char value
value
)

Returns a char value for an element-value pair.

public static AnnotationValue.OfChar

Returns:

a char value for an element-value pair
ofChar
(char
the char value
value
)

Returns a char value for an element-value pair.

public static AnnotationValue.OfClass

Returns:

a class value for an element-value pair
ofClass
(Utf8Entry
the descriptor string of the class
className
)

Returns a class value for an element-value pair.

public static AnnotationValue.OfClass

Returns:

a class value for an element-value pair
ofClass
(ClassDesc
the descriptor of the class
className
)

Returns a class value for an element-value pair.

public static AnnotationValue.OfDouble

Returns:

a double value for an element-value pair
ofDouble
(DoubleEntry
the double value
value
)

Returns a double value for an element-value pair.

public static AnnotationValue.OfDouble

Returns:

a double value for an element-value pair
ofDouble
(double
the double value
value
)

Returns a double value for an element-value pair.

public static AnnotationValue.OfEnum

Returns:

an enum value for an element-value pair
ofEnum
(Utf8Entry
the descriptor string of the enum class
className
,
Utf8Entry
the name of the enum constant
constantName
)

Returns an enum value for an element-value pair.

public static AnnotationValue.OfEnum

Returns:

an enum value for an element-value pair
ofEnum
(ClassDesc
the descriptor of the enum class
className
,
String
the name of the enum constant
constantName
)

Returns an enum value for an element-value pair.

public static AnnotationValue.OfFloat

Returns:

a float value for an element-value pair
ofFloat
(FloatEntry
the float value
value
)

Returns a float value for an element-value pair.

public static AnnotationValue.OfFloat

Returns:

a float value for an element-value pair
ofFloat
(float
the float value
value
)

Returns a float value for an element-value pair.

public static AnnotationValue.OfInt

Returns:

an int value for an element-value pair
ofInt
(IntegerEntry
the int value
value
)

Returns an int value for an element-value pair.

public static AnnotationValue.OfInt

Returns:

an int value for an element-value pair
ofInt
(int
the int value
value
)

Returns an int value for an element-value pair.

public static AnnotationValue.OfLong

Returns:

a long value for an element-value pair
ofLong
(LongEntry
the long value
value
)

Returns a long value for an element-value pair.

public static AnnotationValue.OfLong

Returns:

a long value for an element-value pair
ofLong
(long
the long value
value
)

Returns a long value for an element-value pair.

public static AnnotationValue.OfShort

Returns:

a short value for an element-value pair
ofShort
(IntegerEntry
the short value
value
)

Returns a short value for an element-value pair.

public static AnnotationValue.OfShort

Returns:

a short value for an element-value pair
ofShort
(short
the short value
value
)

Returns a short value for an element-value pair.

public static AnnotationValue.OfString

Returns:

a string value for an element-value pair
ofString
(Utf8Entry
the string
value
)

Returns a string value for an element-value pair.

public static AnnotationValue.OfString

Returns:

a string value for an element-value pair
ofString
(String
the string
value
)

Returns a string value for an element-value pair.

public int

Returns:

the tag character for this value as per JVMS 4.7.16.1
tag
()

Returns the tag character for this value as per JVMS 4.7.16.1.