Interface AnnotationValue
- All Known Subinterfaces:
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.OfString
public sealed interface AnnotationValue
permits AnnotationValue.OfAnnotation, AnnotationValue.OfArray, AnnotationValue.OfConstant, AnnotationValue.OfClass, AnnotationValue.OfEnum
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Models an annotation value of an element-value pair.static interface
Models an array value of an element-value pair.static interface
Models a boolean value of an element-value pair.static interface
Models a byte value of an element-value pair.static interface
Models a char value of an element-value pair.static interface
Models a class value of an element-value pair.static interface
Models a constant value of an element-value pair.static interface
Models a double value of an element-value pair.static interface
Models an enum value of an element-value pair.static interface
Models a float value of an element-value pair.static interface
Models an int value of an element-value pair.static interface
Models a long value of an element-value pair.static interface
Models a short value of an element-value pair.static interface
Models a string value of an element-value pair. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfAnnotation
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfArray
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfBoolean
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfByte
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfChar
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfClass
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfDouble
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfEnum
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfFloat
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfInt
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfLong
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfShort
.static final int
Thetag
indicating the value of an element-value pair isAnnotationValue.OfString
. -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationValue
Returns an annotation element.static AnnotationValue.OfAnnotation
ofAnnotation
(Annotation value) Returns an annotation value for an element-value pair.static AnnotationValue.OfArray
ofArray
(AnnotationValue... values) Returns an array value for an element-value pair.static AnnotationValue.OfArray
ofArray
(List<AnnotationValue> values) Returns an array value for an element-value pair.static AnnotationValue.OfBoolean
ofBoolean
(boolean value) Returns a boolean value for an element-value pair.static AnnotationValue.OfBoolean
ofBoolean
(IntegerEntry value) Returns a boolean value for an element-value pair.static AnnotationValue.OfByte
ofByte
(byte value) Returns a byte value for an element-value pair.static AnnotationValue.OfByte
ofByte
(IntegerEntry value) Returns a byte value for an element-value pair.static AnnotationValue.OfChar
ofChar
(char value) Returns a char value for an element-value pair.static AnnotationValue.OfChar
ofChar
(IntegerEntry value) Returns a char value for an element-value pair.static AnnotationValue.OfClass
Returns a class value for an element-value pair.static AnnotationValue.OfClass
Returns a class value for an element-value pair.static AnnotationValue.OfDouble
ofDouble
(double value) Returns a double value for an element-value pair.static AnnotationValue.OfDouble
ofDouble
(DoubleEntry value) Returns a double value for an element-value pair.static AnnotationValue.OfEnum
Returns an enum value for an element-value pair.static AnnotationValue.OfEnum
Returns an enum value for an element-value pair.static AnnotationValue.OfFloat
ofFloat
(float value) Returns a float value for an element-value pair.static AnnotationValue.OfFloat
ofFloat
(FloatEntry value) Returns a float value for an element-value pair.static AnnotationValue.OfInt
ofInt
(int value) Returns an int value for an element-value pair.static AnnotationValue.OfInt
ofInt
(IntegerEntry value) Returns an int value for an element-value pair.static AnnotationValue.OfLong
ofLong
(long value) Returns a long value for an element-value pair.static AnnotationValue.OfLong
Returns a long value for an element-value pair.static AnnotationValue.OfShort
ofShort
(short value) Returns a short value for an element-value pair.static AnnotationValue.OfShort
ofShort
(IntegerEntry value) Returns a short value for an element-value pair.static AnnotationValue.OfString
Returns a string value for an element-value pair.static AnnotationValue.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.
-
Field Details
-
TAG_BYTE
static final int TAG_BYTEThetag
indicating the value of an element-value pair isAnnotationValue.OfByte
.- See Also:
-
TAG_CHAR
static final int TAG_CHARThetag
indicating the value of an element-value pair isAnnotationValue.OfChar
.- See Also:
-
TAG_DOUBLE
static final int TAG_DOUBLEThetag
indicating the value of an element-value pair isAnnotationValue.OfDouble
.- See Also:
-
TAG_FLOAT
static final int TAG_FLOATThetag
indicating the value of an element-value pair isAnnotationValue.OfFloat
.- See Also:
-
TAG_INT
static final int TAG_INTThetag
indicating the value of an element-value pair isAnnotationValue.OfInt
.- See Also:
-
TAG_LONG
static final int TAG_LONGThetag
indicating the value of an element-value pair isAnnotationValue.OfLong
.- See Also:
-
TAG_SHORT
static final int TAG_SHORTThetag
indicating the value of an element-value pair isAnnotationValue.OfShort
.- See Also:
-
TAG_BOOLEAN
static final int TAG_BOOLEANThetag
indicating the value of an element-value pair isAnnotationValue.OfBoolean
.- See Also:
-
TAG_STRING
static final int TAG_STRINGThetag
indicating the value of an element-value pair isAnnotationValue.OfString
.- See Also:
-
TAG_ENUM
static final int TAG_ENUMThetag
indicating the value of an element-value pair isAnnotationValue.OfEnum
.- See Also:
-
TAG_CLASS
static final int TAG_CLASSThetag
indicating the value of an element-value pair isAnnotationValue.OfClass
.- See Also:
-
TAG_ANNOTATION
static final int TAG_ANNOTATIONThetag
indicating the value of an element-value pair isAnnotationValue.OfAnnotation
.- See Also:
-
TAG_ARRAY
static final int TAG_ARRAYThetag
indicating the value of an element-value pair isAnnotationValue.OfArray
.- See Also:
-
-
Method Details
-
tag
int tag()Returns the tag character for this value as per JVMS 4.7.16.1. The tag characters have a one-to-one mapping to the types of annotation element values. -
ofEnum
Returns an enum value for an element-value pair.- Parameters:
className
- the descriptor string of the enum classconstantName
- the name of the enum constant- Returns:
- an enum value for an element-value pair
-
ofEnum
Returns an enum value for an element-value pair.- Parameters:
className
- the descriptor of the enum classconstantName
- the name of the enum constant- Returns:
- an enum value for an element-value pair
-
ofClass
Returns a class value for an element-value pair.- Parameters:
className
- the descriptor string of the class- Returns:
- a class value for an element-value pair
-
ofClass
Returns a class value for an element-value pair.- Parameters:
className
- the descriptor of the class- Returns:
- a class value for an element-value pair
-
ofString
Returns a string value for an element-value pair.- Parameters:
value
- the string- Returns:
- a string value for an element-value pair
-
ofString
Returns a string value for an element-value pair.- Parameters:
value
- the string- Returns:
- a string value for an element-value pair
-
ofDouble
Returns a double value for an element-value pair.- Parameters:
value
- the double value- Returns:
- a double value for an element-value pair
-
ofDouble
Returns a double value for an element-value pair.- Parameters:
value
- the double value- Returns:
- a double value for an element-value pair
-
ofFloat
Returns a float value for an element-value pair.- Parameters:
value
- the float value- Returns:
- a float value for an element-value pair
-
ofFloat
Returns a float value for an element-value pair.- Parameters:
value
- the float value- Returns:
- a float value for an element-value pair
-
ofLong
Returns a long value for an element-value pair.- Parameters:
value
- the long value- Returns:
- a long value for an element-value pair
-
ofLong
Returns a long value for an element-value pair.- Parameters:
value
- the long value- Returns:
- a long value for an element-value pair
-
ofInt
Returns an int value for an element-value pair.- Parameters:
value
- the int value- Returns:
- an int value for an element-value pair
-
ofInt
Returns an int value for an element-value pair.- Parameters:
value
- the int value- Returns:
- an int value for an element-value pair
-
ofShort
Returns a short value for an element-value pair.- Parameters:
value
- the short value- Returns:
- a short value for an element-value pair
-
ofShort
Returns a short value for an element-value pair.- Parameters:
value
- the short value- Returns:
- a short value for an element-value pair
-
ofChar
Returns a char value for an element-value pair.- Parameters:
value
- the char value- Returns:
- a char value for an element-value pair
-
ofChar
Returns a char value for an element-value pair.- Parameters:
value
- the char value- Returns:
- a char value for an element-value pair
-
ofByte
Returns a byte value for an element-value pair.- Parameters:
value
- the byte value- Returns:
- a byte value for an element-value pair
-
ofByte
Returns a byte value for an element-value pair.- Parameters:
value
- the byte value- Returns:
- a byte value for an element-value pair
-
ofBoolean
Returns a boolean value for an element-value pair.- Parameters:
value
- the boolean value- Returns:
- a boolean value for an element-value pair
-
ofBoolean
Returns a boolean value for an element-value pair.- Parameters:
value
- the boolean value- Returns:
- a boolean value for an element-value pair
-
ofAnnotation
Returns an annotation value for an element-value pair.- Parameters:
value
- the annotation- Returns:
- an annotation value for an element-value pair
-
ofArray
Returns an array value for an element-value pair.- API Note:
- See
values()
for conventions on array values derived from Java source code. - Parameters:
values
- the array elements- Returns:
- an array value for an element-value pair
-
ofArray
Returns an array value for an element-value pair.- API Note:
- See
values()
for conventions on array values derived from Java source code. - Parameters:
values
- the array elements- Returns:
- an array value for an element-value pair
-
of
Returns an annotation element. Thevalue
parameter 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 thevalue
parameter is not a primitive, a wrapper of primitive, a String, a ClassDesc, an enum constant, or an array of one of these.
-