AnnotationValue.OfAnnotation, AnnotationValue.OfArray, AnnotationValue.OfBoolean, AnnotationValue.OfByte, AnnotationValue.OfChar, AnnotationValue.OfClass, AnnotationValue.OfConstant, AnnotationValue.OfDouble, AnnotationValue.OfEnum, AnnotationValue.OfFloat, AnnotationValue.OfInt, AnnotationValue.OfLong, AnnotationValue.OfShort, AnnotationValue.OfStringpublic sealed interface AnnotationValue permits AnnotationValue.OfAnnotation, AnnotationValue.OfArray, AnnotationValue.OfConstant, AnnotationValue.OfClass, AnnotationValue.OfEnum
| Modifier and Type | Interface | Description |
|---|---|---|
static interface |
AnnotationValue.OfAnnotation |
Models an annotation value of an element-value pair. |
static interface |
AnnotationValue.OfArray |
Models an array value of an element-value pair. |
static interface |
AnnotationValue.OfBoolean |
Models a boolean value of an element-value pair. |
static interface |
AnnotationValue.OfByte |
Models a byte value of an element-value pair. |
static interface |
AnnotationValue.OfChar |
Models a char value of an element-value pair. |
static interface |
AnnotationValue.OfClass |
Models a class value of an element-value pair. |
static interface |
AnnotationValue.OfConstant |
Models a constant value of an element-value pair. |
static interface |
AnnotationValue.OfDouble |
Models a double value of an element-value pair. |
static interface |
AnnotationValue.OfEnum |
Models an enum value of an element-value pair. |
static interface |
AnnotationValue.OfFloat |
Models a float value of an element-value pair. |
static interface |
AnnotationValue.OfInt |
Models an int value of an element-value pair. |
static interface |
AnnotationValue.OfLong |
Models a long value of an element-value pair. |
static interface |
AnnotationValue.OfShort |
Models a short value of an element-value pair. |
static interface |
AnnotationValue.OfString |
Models a string value of an element-value pair. |
| Modifier and Type | Field | Description |
|---|---|---|
static final int |
TAG_ANNOTATION |
The tag indicating the value of an element-value pair is AnnotationValue.OfAnnotation. |
static final int |
TAG_ARRAY |
The tag indicating the value of an element-value pair is AnnotationValue.OfArray. |
static final int |
TAG_BOOLEAN |
The tag indicating the value of an element-value pair is AnnotationValue.OfBoolean. |
static final int |
TAG_BYTE |
The tag indicating the value of an element-value pair is AnnotationValue.OfByte. |
static final int |
TAG_CHAR |
The tag indicating the value of an element-value pair is AnnotationValue.OfChar. |
static final int |
TAG_CLASS |
The tag indicating the value of an element-value pair is AnnotationValue.OfClass. |
static final int |
TAG_DOUBLE |
The tag indicating the value of an element-value pair is AnnotationValue.OfDouble. |
static final int |
TAG_ENUM |
The tag indicating the value of an element-value pair is AnnotationValue.OfEnum. |
static final int |
TAG_FLOAT |
The tag indicating the value of an element-value pair is AnnotationValue.OfFloat. |
static final int |
TAG_INT |
The tag indicating the value of an element-value pair is AnnotationValue.OfInt. |
static final int |
TAG_LONG |
The tag indicating the value of an element-value pair is AnnotationValue.OfLong. |
static final int |
TAG_SHORT |
The tag indicating the value of an element-value pair is AnnotationValue.OfShort. |
static final int |
TAG_STRING |
The tag indicating the value of an element-value pair is AnnotationValue.OfString. |
| Modifier and Type | Method | Description |
|---|---|---|
static AnnotationValue |
of |
Returns an annotation element. |
static AnnotationValue.OfAnnotation |
ofAnnotation |
Returns an annotation value for an element-value pair. |
static AnnotationValue.OfArray |
ofArray |
Returns an array value for an element-value pair. |
static AnnotationValue.OfArray |
ofArray |
Returns an array value for an element-value pair. |
static AnnotationValue.OfBoolean |
ofBoolean |
Returns a boolean value for an element-value pair. |
static AnnotationValue.OfBoolean |
ofBoolean |
Returns a boolean value for an element-value pair. |
static AnnotationValue.OfByte |
ofByte |
Returns a byte value for an element-value pair. |
static AnnotationValue.OfByte |
ofByte |
Returns a byte value for an element-value pair. |
static AnnotationValue.OfChar |
ofChar |
Returns a char value for an element-value pair. |
static AnnotationValue.OfChar |
ofChar |
Returns a char value for an element-value pair. |
static AnnotationValue.OfClass |
ofClass |
Returns a class value for an element-value pair. |
static AnnotationValue.OfClass |
ofClass |
Returns a class value for an element-value pair. |
static AnnotationValue.OfDouble |
ofDouble |
Returns a double value for an element-value pair. |
static AnnotationValue.OfDouble |
ofDouble |
Returns a double value for an element-value pair. |
static AnnotationValue.OfEnum |
ofEnum |
Returns an enum value for an element-value pair. |
static AnnotationValue.OfEnum |
ofEnum |
Returns an enum value for an element-value pair. |
static AnnotationValue.OfFloat |
ofFloat |
Returns a float value for an element-value pair. |
static AnnotationValue.OfFloat |
ofFloat |
Returns a float value for an element-value pair. |
static AnnotationValue.OfInt |
ofInt |
Returns an int value for an element-value pair. |
static AnnotationValue.OfInt |
ofInt |
Returns an int value for an element-value pair. |
static AnnotationValue.OfLong |
ofLong |
Returns a long value for an element-value pair. |
static AnnotationValue.OfLong |
ofLong |
Returns a long value for an element-value pair. |
static AnnotationValue.OfShort |
ofShort |
Returns a short value for an element-value pair. |
static AnnotationValue.OfShort |
ofShort |
Returns a short value for an element-value pair. |
static AnnotationValue.OfString |
ofString |
Returns a string value for an element-value pair. |
static AnnotationValue.OfString |
ofString |
Returns a string value for an element-value pair. |
int |
tag() |
Returns the tag character for this value as per JVMS 4.7.16.1. |
static final int TAG_BYTE
tag indicating the value of an element-value pair is AnnotationValue.OfByte.static final int TAG_CHAR
tag indicating the value of an element-value pair is AnnotationValue.OfChar.static final int TAG_DOUBLE
tag indicating the value of an element-value pair is AnnotationValue.OfDouble.static final int TAG_FLOAT
tag indicating the value of an element-value pair is AnnotationValue.OfFloat.static final int TAG_INT
tag indicating the value of an element-value pair is AnnotationValue.OfInt.static final int TAG_LONG
tag indicating the value of an element-value pair is AnnotationValue.OfLong.static final int TAG_SHORT
tag indicating the value of an element-value pair is AnnotationValue.OfShort.static final int TAG_BOOLEAN
tag indicating the value of an element-value pair is AnnotationValue.OfBoolean.static final int TAG_STRING
tag indicating the value of an element-value pair is AnnotationValue.OfString.static final int TAG_ENUM
tag indicating the value of an element-value pair is AnnotationValue.OfEnum.static final int TAG_CLASS
tag indicating the value of an element-value pair is AnnotationValue.OfClass.static final int TAG_ANNOTATION
tag indicating the value of an element-value pair is AnnotationValue.OfAnnotation.static final int TAG_ARRAY
tag indicating the value of an element-value pair is AnnotationValue.OfArray.int tag()
static AnnotationValue.OfEnum ofEnum(Utf8Entry className, Utf8Entry constantName)
className - the descriptor string of the enum classconstantName - the name of the enum constantstatic AnnotationValue.OfEnum ofEnum(ClassDesc className, String constantName)
className - the descriptor of the enum classconstantName - the name of the enum constantstatic AnnotationValue.OfClass ofClass(Utf8Entry className)
className - the descriptor string of the classstatic AnnotationValue.OfClass ofClass(ClassDesc className)
className - the descriptor of the classstatic AnnotationValue.OfString ofString(Utf8Entry value)
value - the stringstatic AnnotationValue.OfString ofString(String value)
value - the stringstatic AnnotationValue.OfDouble ofDouble(DoubleEntry value)
value - the double valuestatic AnnotationValue.OfDouble ofDouble(double value)
value - the double valuestatic AnnotationValue.OfFloat ofFloat(FloatEntry value)
value - the float valuestatic AnnotationValue.OfFloat ofFloat(float value)
value - the float valuestatic AnnotationValue.OfLong ofLong(LongEntry value)
value - the long valuestatic AnnotationValue.OfLong ofLong(long value)
value - the long valuestatic AnnotationValue.OfInt ofInt(IntegerEntry value)
value - the int valuestatic AnnotationValue.OfInt ofInt(int value)
value - the int valuestatic AnnotationValue.OfShort ofShort(IntegerEntry value)
value - the short valuestatic AnnotationValue.OfShort ofShort(short value)
value - the short valuestatic AnnotationValue.OfChar ofChar(IntegerEntry value)
value - the char valuestatic AnnotationValue.OfChar ofChar(char value)
value - the char valuestatic AnnotationValue.OfByte ofByte(IntegerEntry value)
value - the byte valuestatic AnnotationValue.OfByte ofByte(byte value)
value - the byte valuestatic AnnotationValue.OfBoolean ofBoolean(IntegerEntry value)
value - the boolean valuestatic AnnotationValue.OfBoolean ofBoolean(boolean value)
value - the boolean valuestatic AnnotationValue.OfAnnotation ofAnnotation(Annotation value)
value - the annotationstatic AnnotationValue.OfArray ofArray(List<AnnotationValue> values)
values() for conventions on array values derived from Java source code.values - the array elementsstatic AnnotationValue.OfArray ofArray(AnnotationValue... values)
values() for conventions on array values derived from Java source code.values - the array elementsstatic AnnotationValue of(Object value)
value parameter must be a primitive, a wrapper of primitive, a String, a ClassDesc, an enum constant, or an array of one of these.value - the annotation valueIllegalArgumentException - when the value parameter is not a primitive, a wrapper of primitive, a String, a ClassDesc, an enum constant, or an array of one of these.
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/classfile/AnnotationValue.html