Interface AnnotationValue
- All Superinterfaces:
ClassFileElementPREVIEW,WritableElementPREVIEW<AnnotationValuePREVIEW>
- All Known Subinterfaces:
AnnotationValue.OfAnnotationPREVIEW,AnnotationValue.OfArrayPREVIEW,AnnotationValue.OfBooleanPREVIEW,AnnotationValue.OfBytePREVIEW,AnnotationValue.OfCharacterPREVIEW,AnnotationValue.OfClassPREVIEW,AnnotationValue.OfConstantPREVIEW,AnnotationValue.OfDoublePREVIEW,AnnotationValue.OfEnumPREVIEW,AnnotationValue.OfFloatPREVIEW,AnnotationValue.OfIntegerPREVIEW,AnnotationValue.OfLongPREVIEW,AnnotationValue.OfShortPREVIEW,AnnotationValue.OfStringPREVIEW
public sealed interface AnnotationValue
extends WritableElementPREVIEW<AnnotationValuePREVIEW>
permits AnnotationValue.OfAnnotationPREVIEW, AnnotationValue.OfArrayPREVIEW, AnnotationValue.OfConstantPREVIEW, AnnotationValue.OfClassPREVIEW, AnnotationValue.OfEnumPREVIEW
AnnotationValue is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the value of a key-value pair of an annotation.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacePreview.Models an annotation-valued elementstatic interfacePreview.Models an array-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a class-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models an enum-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a constant-valued elementstatic interfacePreview.Models a constant-valued element -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationValuePREVIEWReturns an annotation element.ofAnnotation(AnnotationPREVIEW value) Returns an annotation element for an annotation-valued element.ofArray(AnnotationValuePREVIEW... values) Returns an annotation element for an array-valued element.ofArray(List<AnnotationValuePREVIEW> values) Returns an annotation element for an array-valued element.ofBoolean(boolean value) Returns an annotation element for a boolean-valued element.ofBoolean(IntegerEntryPREVIEW value) Returns an annotation element for a boolean-valued element.ofByte(byte value) Returns an annotation element for a byte-valued element.ofByte(IntegerEntryPREVIEW value) Returns an annotation element for a byte-valued element.ofChar(char value) Returns an annotation element for a char-valued element.ofChar(IntegerEntryPREVIEW value) Returns an annotation element for a char-valued element.Returns an annotation element for a class-valued element.Returns an annotation element for a class-valued element.ofDouble(double value) Returns an annotation element for a double-valued element.ofDouble(DoubleEntryPREVIEW value) Returns an annotation element for a double-valued element.Returns an annotation element for a enum-valued element.Returns an annotation element for a enum-valued element.ofFloat(float value) Returns an annotation element for a float-valued element.ofFloat(FloatEntryPREVIEW value) Returns an annotation element for a float-valued element.ofInt(int value) Returns an annotation element for an int-valued element.ofInt(IntegerEntryPREVIEW value) Returns an annotation element for an int-valued element.ofLong(long value) Returns an annotation element for a long-valued element.Returns an annotation element for a long-valued element.ofShort(short value) Returns an annotation element for a short-valued element.ofShort(IntegerEntryPREVIEW value) Returns an annotation element for a short-valued element.Returns an annotation element for a string-valued element.Returns an annotation element for a string-valued element.chartag()Returns the tag character for this type as per 4.7.16.1.Methods declared in interface java.lang.classfile.WritableElementPREVIEW
writeTo
-
Method Details
-
tag
-
ofEnum
static AnnotationValue.OfEnumPREVIEW ofEnum(Utf8EntryPREVIEW className, Utf8EntryPREVIEW constantName) Returns an annotation element for a enum-valued element.- Parameters:
className- the name of the enum classconstantName- the name of the enum constant- Returns:
- an annotation element for a enum-valued element
-
ofEnum
Returns an annotation element for a enum-valued element.- Parameters:
className- the name of the enum classconstantName- the name of the enum constant- Returns:
- an annotation element for a enum-valued element
-
ofClass
Returns an annotation element for a class-valued element.- Parameters:
className- the name of the enum class- Returns:
- an annotation element for a class-valued element
-
ofClass
Returns an annotation element for a class-valued element.- Parameters:
className- the name of the enum class- Returns:
- an annotation element for a class-valued element
-
ofString
Returns an annotation element for a string-valued element.- Parameters:
value- the string- Returns:
- an annotation element for a string-valued element
-
ofString
Returns an annotation element for a string-valued element.- Parameters:
value- the string- Returns:
- an annotation element for a string-valued element
-
ofDouble
Returns an annotation element for a double-valued element.- Parameters:
value- the double value- Returns:
- an annotation element for a double-valued element
-
ofDouble
Returns an annotation element for a double-valued element.- Parameters:
value- the double value- Returns:
- an annotation element for a double-valued element
-
ofFloat
Returns an annotation element for a float-valued element.- Parameters:
value- the float value- Returns:
- an annotation element for a float-valued element
-
ofFloat
Returns an annotation element for a float-valued element.- Parameters:
value- the float value- Returns:
- an annotation element for a float-valued element
-
ofLong
Returns an annotation element for a long-valued element.- Parameters:
value- the long value- Returns:
- an annotation element for a long-valued element
-
ofLong
Returns an annotation element for a long-valued element.- Parameters:
value- the long value- Returns:
- an annotation element for a long-valued element
-
ofInt
Returns an annotation element for an int-valued element.- Parameters:
value- the int value- Returns:
- an annotation element for an int-valued element
-
ofInt
Returns an annotation element for an int-valued element.- Parameters:
value- the int value- Returns:
- an annotation element for an int-valued element
-
ofShort
Returns an annotation element for a short-valued element.- Parameters:
value- the short value- Returns:
- an annotation element for a short-valued element
-
ofShort
Returns an annotation element for a short-valued element.- Parameters:
value- the short value- Returns:
- an annotation element for a short-valued element
-
ofChar
Returns an annotation element for a char-valued element.- Parameters:
value- the char value- Returns:
- an annotation element for a char-valued element
-
ofChar
Returns an annotation element for a char-valued element.- Parameters:
value- the char value- Returns:
- an annotation element for a char-valued element
-
ofByte
Returns an annotation element for a byte-valued element.- Parameters:
value- the byte value- Returns:
- an annotation element for a byte-valued element
-
ofByte
Returns an annotation element for a byte-valued element.- Parameters:
value- the byte value- Returns:
- an annotation element for a byte-valued element
-
ofBoolean
Returns an annotation element for a boolean-valued element.- Parameters:
value- the boolean value- Returns:
- an annotation element for a boolean-valued element
-
ofBoolean
Returns an annotation element for a boolean-valued element.- Parameters:
value- the boolean value- Returns:
- an annotation element for a boolean-valued element
-
ofAnnotation
Returns an annotation element for an annotation-valued element.- Parameters:
value- the annotation- Returns:
- an annotation element for an annotation-valued element
-
ofArray
Returns an annotation element for an array-valued element.- Parameters:
values- the values- Returns:
- an annotation element for an array-valued element
-
ofArray
Returns an annotation element for an array-valued element.- Parameters:
values- the values- Returns:
- an annotation element for an array-valued element
-
of
Returns an annotation element. Thevalueparameter must be a primitive, a wrapper of primitive, a String, a ClassDesc, an enum constant, or an array of one of these.- Parameters:
value- the annotation value- Returns:
- an annotation element
- Throws:
IllegalArgumentException- when thevalueparameter is not a primitive, a wrapper of primitive, a String, a ClassDesc, an enum constant, or an array of one of these.
-
AnnotationValuewhen preview features are enabled.