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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceModels an annotation value of an element-value pair.static interfaceModels an array value of an element-value pair.static interfaceModels a boolean value of an element-value pair.static interfaceModels a byte value of an element-value pair.static interfaceModels a char value of an element-value pair.static interfaceModels a class value of an element-value pair.static interfaceModels a constant value of an element-value pair.static interfaceModels a double value of an element-value pair.static interfaceModels an enum value of an element-value pair.static interfaceModels a float value of an element-value pair.static interfaceModels an int value of an element-value pair.static interfaceModels a long value of an element-value pair.static interfaceModels a short value of an element-value pair.static interfaceModels a string value of an element-value pair. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThetagindicating the value of an element-value pair isAnnotationValue.OfAnnotation.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfArray.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfBoolean.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfByte.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfChar.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfClass.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfDouble.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfEnum.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfFloat.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfInt.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfLong.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfShort.static final intThetagindicating the value of an element-value pair isAnnotationValue.OfString. -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationValueReturns an annotation element.static AnnotationValue.OfAnnotationofAnnotation(Annotation value) Returns an annotation value for an element-value pair.static AnnotationValue.OfArrayofArray(AnnotationValue... values) Returns an array value for an element-value pair.static AnnotationValue.OfArrayofArray(List<AnnotationValue> values) Returns an array value for an element-value pair.static AnnotationValue.OfBooleanofBoolean(boolean value) Returns a boolean value for an element-value pair.static AnnotationValue.OfBooleanofBoolean(IntegerEntry value) Returns a boolean value for an element-value pair.static AnnotationValue.OfByteofByte(byte value) Returns a byte value for an element-value pair.static AnnotationValue.OfByteofByte(IntegerEntry value) Returns a byte value for an element-value pair.static AnnotationValue.OfCharofChar(char value) Returns a char value for an element-value pair.static AnnotationValue.OfCharofChar(IntegerEntry value) Returns a char value for an element-value pair.static AnnotationValue.OfClassReturns a class value for an element-value pair.static AnnotationValue.OfClassReturns a class value for an element-value pair.static AnnotationValue.OfDoubleofDouble(double value) Returns a double value for an element-value pair.static AnnotationValue.OfDoubleofDouble(DoubleEntry value) Returns a double value for an element-value pair.static AnnotationValue.OfEnumReturns an enum value for an element-value pair.static AnnotationValue.OfEnumReturns an enum value for an element-value pair.static AnnotationValue.OfFloatofFloat(float value) Returns a float value for an element-value pair.static AnnotationValue.OfFloatofFloat(FloatEntry value) Returns a float value for an element-value pair.static AnnotationValue.OfIntofInt(int value) Returns an int value for an element-value pair.static AnnotationValue.OfIntofInt(IntegerEntry value) Returns an int value for an element-value pair.static AnnotationValue.OfLongofLong(long value) Returns a long value for an element-value pair.static AnnotationValue.OfLongReturns a long value for an element-value pair.static AnnotationValue.OfShortofShort(short value) Returns a short value for an element-value pair.static AnnotationValue.OfShortofShort(IntegerEntry value) Returns a short value for an element-value pair.static AnnotationValue.OfStringReturns a string value for an element-value pair.static AnnotationValue.OfStringReturns a string value for an element-value pair.inttag()Returns the tag character for this value as per JVMS 4.7.16.1.
-
Field Details
-
TAG_BYTE
static final int TAG_BYTEThetagindicating the value of an element-value pair isAnnotationValue.OfByte.- See Also:
-
TAG_CHAR
static final int TAG_CHARThetagindicating the value of an element-value pair isAnnotationValue.OfChar.- See Also:
-
TAG_DOUBLE
static final int TAG_DOUBLEThetagindicating the value of an element-value pair isAnnotationValue.OfDouble.- See Also:
-
TAG_FLOAT
static final int TAG_FLOATThetagindicating the value of an element-value pair isAnnotationValue.OfFloat.- See Also:
-
TAG_INT
static final int TAG_INTThetagindicating the value of an element-value pair isAnnotationValue.OfInt.- See Also:
-
TAG_LONG
static final int TAG_LONGThetagindicating the value of an element-value pair isAnnotationValue.OfLong.- See Also:
-
TAG_SHORT
static final int TAG_SHORTThetagindicating the value of an element-value pair isAnnotationValue.OfShort.- See Also:
-
TAG_BOOLEAN
static final int TAG_BOOLEANThetagindicating the value of an element-value pair isAnnotationValue.OfBoolean.- See Also:
-
TAG_STRING
static final int TAG_STRINGThetagindicating the value of an element-value pair isAnnotationValue.OfString.- See Also:
-
TAG_ENUM
static final int TAG_ENUMThetagindicating the value of an element-value pair isAnnotationValue.OfEnum.- See Also:
-
TAG_CLASS
static final int TAG_CLASSThetagindicating the value of an element-value pair isAnnotationValue.OfClass.- See Also:
-
TAG_ANNOTATION
static final int TAG_ANNOTATIONThetagindicating the value of an element-value pair isAnnotationValue.OfAnnotation.- See Also:
-
TAG_ARRAY
static final int TAG_ARRAYThetagindicating 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. 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.
-