Package org.jboss.jandex
Class AnnotationValue.ArrayValue
java.lang.Object
org.jboss.jandex.AnnotationValue
org.jboss.jandex.AnnotationValue.ArrayValue
- Enclosing class:
AnnotationValue
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.jandex.AnnotationValue
AnnotationValue.ArrayValue, AnnotationValue.BooleanValue, AnnotationValue.ByteValue, AnnotationValue.CharacterValue, AnnotationValue.ClassValue, AnnotationValue.DoubleValue, AnnotationValue.EnumValue, AnnotationValue.FloatValue, AnnotationValue.IntegerValue, AnnotationValue.Kind, AnnotationValue.LongValue, AnnotationValue.NestedAnnotation, AnnotationValue.ShortValue, AnnotationValue.StringValue
-
Field Summary
FieldsFields inherited from class org.jboss.jandex.AnnotationValue
EMPTY_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) AnnotationValue[]
asArray()
Returns the underlying array value as aList
ofAnnotationValue
.boolean[]
Returns the underlying boolean array.byte[]
Converts an underlying numerical array to a Java primitive byte array.char[]
Returns the underlying character array.Type[]
Returns an array of class types representing the underlying class array value.double[]
Converts an underlying numerical array to a Java primitive double array.String[]
Returns an array of the constant name, in string form, that represents the Java enumeration of each array element The individual element values are the same as the one returned byEnum.name()
.DotName[]
Returns an array of the type name, in DotName form, that represents the Java enumeration of each array element.float[]
Converts an underlying numerical array to a Java primitive float array.int[]
Converts an underlying numerical array to a Java primitive integer array.long[]
Converts an underlying numerical array to a Java primitive long array.Returns an array of nested annotations representing the underlying annotation array value.short[]
Converts an underlying numerical array to a Java primitive short array.String[]
Returns a string array representation of the underlying array value.Returns the kind of value that represents the component type of this array if it can be determined.boolean
Compares this annotation value to another annotation value, and returns true if equal.int
hashCode()
Computes a hash code for this annotation value.kind()
Returns the kind of this value.(package private) String
toString
(boolean includeName) value()
Returns a detyped value that represents the underlying annotation value.Methods inherited from class org.jboss.jandex.AnnotationValue
asBoolean, asByte, asChar, asClass, asDouble, asEnum, asEnumType, asFloat, asInt, asLong, asNested, asShort, asString, createArrayValue, createArrayValue, createBooleanValue, createByteValue, createCharacterValue, createClassValue, createDoubleValue, createDouleValue, createEnumValue, createFloatValue, createIntegerValue, createLongalue, createLongValue, createNestedAnnotationValue, createShortValue, createStringValue, name, toString
-
Field Details
-
value
-
-
Constructor Details
-
ArrayValue
ArrayValue(String name, AnnotationValue[] value)
-
-
Method Details
-
value
Description copied from class:AnnotationValue
Returns a detyped value that represents the underlying annotation value. It is recommended that the type specific methods be used instead.- Specified by:
value
in classAnnotationValue
- Returns:
- the underlying value
-
kind
Description copied from class:AnnotationValue
Returns the kind of this value. The kind includes all Java primitives, String and Enum types, nested values, and finally arrays of the above. Since the return type is itself an enumeration, it can be used with Java switch statements.A special
AnnotationValue.Kind.UNKNOWN
kind is used to refer to components of zero-length arrays, as the underlying type is not known.- Specified by:
kind
in classAnnotationValue
- Returns:
- the kind of value
-
componentKind
Description copied from class:AnnotationValue
Returns the kind of value that represents the component type of this array if it can be determined. Otherwise, this method returnsAnnotationValue.Kind.UNKNOWN
. This happens when the annotation value represents an empty array. If the underlying value is not an array an exception will be thrown.- Overrides:
componentKind
in classAnnotationValue
- Returns:
- the kind of component, or
AnnotationValue.Kind.UNKNOWN
if it can not be determined.
-
asArray
AnnotationValue[] asArray()- Overrides:
asArray
in classAnnotationValue
-
asArrayList
Description copied from class:AnnotationValue
Returns the underlying array value as aList
ofAnnotationValue
.- Overrides:
asArrayList
in classAnnotationValue
- Returns:
- the underlying array value
-
toString
- Overrides:
toString
in classAnnotationValue
-
asIntArray
public int[] asIntArray()Description copied from class:AnnotationValue
Converts an underlying numerical array to a Java primitive integer array.- Overrides:
asIntArray
in classAnnotationValue
- Returns:
- an int array that represents this value
-
asLongArray
public long[] asLongArray()Description copied from class:AnnotationValue
Converts an underlying numerical array to a Java primitive long array.- Overrides:
asLongArray
in classAnnotationValue
- Returns:
- a long array that represents this value
-
asShortArray
public short[] asShortArray()Description copied from class:AnnotationValue
Converts an underlying numerical array to a Java primitive short array.- Overrides:
asShortArray
in classAnnotationValue
- Returns:
- a short array that represents this value
-
asByteArray
public byte[] asByteArray()Description copied from class:AnnotationValue
Converts an underlying numerical array to a Java primitive byte array.- Overrides:
asByteArray
in classAnnotationValue
- Returns:
- a byte array that represents this value
-
asFloatArray
public float[] asFloatArray()Description copied from class:AnnotationValue
Converts an underlying numerical array to a Java primitive float array.- Overrides:
asFloatArray
in classAnnotationValue
- Returns:
- a float array that represents this value
-
asDoubleArray
public double[] asDoubleArray()Description copied from class:AnnotationValue
Converts an underlying numerical array to a Java primitive double array.- Overrides:
asDoubleArray
in classAnnotationValue
- Returns:
- a double array that represents this value
-
asCharArray
public char[] asCharArray()Description copied from class:AnnotationValue
Returns the underlying character array.- Overrides:
asCharArray
in classAnnotationValue
- Returns:
- a character array that represents this value
-
asBooleanArray
public boolean[] asBooleanArray()Description copied from class:AnnotationValue
Returns the underlying boolean array.- Overrides:
asBooleanArray
in classAnnotationValue
- Returns:
- a boolean array that represents this value
-
asStringArray
Description copied from class:AnnotationValue
Returns a string array representation of the underlying array value. The behavior is identical toAnnotationValue.asString()
as if it were applied to every array element.- Overrides:
asStringArray
in classAnnotationValue
- Returns:
- a string array representing the underlying array value
-
asEnumArray
Description copied from class:AnnotationValue
Returns an array of the constant name, in string form, that represents the Java enumeration of each array element The individual element values are the same as the one returned byEnum.name()
.- Overrides:
asEnumArray
in classAnnotationValue
- Returns:
- an array of string names of a Java enums
-
asClassArray
Description copied from class:AnnotationValue
Returns an array of class types representing the underlying class array value. Each element has the same behavior asAnnotationValue.asClass()
- Overrides:
asClassArray
in classAnnotationValue
- Returns:
- a class array representing this class array value
-
asNestedArray
Description copied from class:AnnotationValue
Returns an array of nested annotations representing the underlying annotation array value. Each element has the same behavior asAnnotationValue.asNested()
- Overrides:
asNestedArray
in classAnnotationValue
- Returns:
- an annotation array representing this annotation array value
-
asEnumTypeArray
Description copied from class:AnnotationValue
Returns an array of the type name, in DotName form, that represents the Java enumeration of each array element. The individual element values are the same as the one returned byObject.getClass()
. Note that JLS restricts an enum array parameter to the same type. Also, when an empty array is specified in a value, it's types can not be determined.- Overrides:
asEnumTypeArray
in classAnnotationValue
- Returns:
- an array of string type names of Java enum array elements
-
equals
Description copied from class:AnnotationValue
Compares this annotation value to another annotation value, and returns true if equal.- Overrides:
equals
in classAnnotationValue
- Parameters:
o
- the annotation value to compare to.- Returns:
- true if equal, false if not
- See Also:
-
hashCode
public int hashCode()Description copied from class:AnnotationValue
Computes a hash code for this annotation value.- Overrides:
hashCode
in classAnnotationValue
- Returns:
- the hash code for this annotation value
- See Also:
-