Class AnnotationValue.ArrayValue

java.lang.Object
org.jboss.jandex.AnnotationValue
org.jboss.jandex.AnnotationValue.ArrayValue
Enclosing class:
AnnotationValue

static final class AnnotationValue.ArrayValue extends AnnotationValue
  • Field Details

  • Constructor Details

  • Method Details

    • value

      public AnnotationValue[] 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 class AnnotationValue
      Returns:
      the underlying value
    • kind

      public AnnotationValue.Kind 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 class AnnotationValue
      Returns:
      the kind of value
    • componentKind

      public AnnotationValue.Kind 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 returns AnnotationValue.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 class AnnotationValue
      Returns:
      the kind of component, or AnnotationValue.Kind.UNKNOWN if it can not be determined.
    • asArray

      AnnotationValue[] asArray()
      Overrides:
      asArray in class AnnotationValue
    • toString

      public String toString()
      Overrides:
      toString in class AnnotationValue
    • asIntArray

      public int[] asIntArray()
      Description copied from class: AnnotationValue
      Converts an underlying numerical array to a Java primitive integer array.
      Overrides:
      asIntArray in class AnnotationValue
      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 class AnnotationValue
      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 class AnnotationValue
      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 class AnnotationValue
      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 class AnnotationValue
      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 class AnnotationValue
      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 class AnnotationValue
      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 class AnnotationValue
      Returns:
      a boolean array that represents this value
    • asStringArray

      public String[] asStringArray()
      Description copied from class: AnnotationValue
      Returns a string array representation of the underlying array value. The behavior is identical to AnnotationValue.asString() as if it were applied to every array element.
      Overrides:
      asStringArray in class AnnotationValue
      Returns:
      a string array representing the underlying array value
    • asEnumArray

      public String[] 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 by Enum.name().
      Overrides:
      asEnumArray in class AnnotationValue
      Returns:
      an array of string names of a Java enums
    • asClassArray

      public Type[] asClassArray()
      Description copied from class: AnnotationValue
      Returns an array of class types representing the underlying class array value. Each element has the same behavior as AnnotationValue.asClass()
      Overrides:
      asClassArray in class AnnotationValue
      Returns:
      a class array representing this class array value
    • asNestedArray

      public AnnotationInstance[] asNestedArray()
      Description copied from class: AnnotationValue
      Returns an array of nested annotations representing the underlying annotation array value. Each element has the same behavior as AnnotationValue.asNested()
      Overrides:
      asNestedArray in class AnnotationValue
      Returns:
      an annotation array representing this annotation array value
    • asEnumTypeArray

      public DotName[] 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 by Object.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 class AnnotationValue
      Returns:
      an array of string type names of Java enum array elements
    • equals

      public boolean equals(Object o)
      Description copied from class: AnnotationValue
      Compares this annotation value to another annotation value, and returns true if equal.
      Overrides:
      equals in class AnnotationValue
      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 class AnnotationValue
      Returns:
      the hash code for this annotation value
      See Also: