# Class ArrayElementValueGen

java.lang.Object
org.apache.bcel.generic.ElementValueGen
org.apache.bcel.generic.ArrayElementValueGen

public class ArrayElementValueGen extends ElementValueGen
Generates array element values in annotations.

Since:
  6.0

- ## Field Summary

  ### Fields inherited from class ElementValueGen

  `ANNOTATION, ARRAY, CLASS, cpGen, ENUM_CONSTANT, PRIMITIVE_BOOLEAN, PRIMITIVE_BYTE, PRIMITIVE_CHAR, PRIMITIVE_DOUBLE, PRIMITIVE_FLOAT, PRIMITIVE_INT, PRIMITIVE_LONG, PRIMITIVE_SHORT, STRING, type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ArrayElementValueGen(int type, ElementValue[] elementValues, ConstantPoolGen cpool)`
  Constructs an ArrayElementValueGen.
  `ArrayElementValueGen(ArrayElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  Constructs an ArrayElementValueGen.
  `ArrayElementValueGen(ConstantPoolGen cp)`
  Constructs an ArrayElementValueGen.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addElement(ElementValueGen gen)`
  Adds an element.
  `void`
  `dump(DataOutputStream dos)`
  Dumps this element value to a DataOutputStream.
  `ElementValue`
  `getElementValue()`
  Return immutable variant of this ArrayElementValueGen.
  `List<ElementValueGen>`
  `getElementValues()`
  Gets the element values.
  `int`
  `getElementValuesSize()`
  Gets the element values size.
  `String`
  `stringifyValue()`
  Returns a string representation of the element value.

  ### Methods inherited from class ElementValueGen

  `copy, getConstantPool, getElementValueType, readElementValue`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ArrayElementValueGen

    public ArrayElementValueGen(ArrayElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)
    Constructs an ArrayElementValueGen.
    Parameters:
      `value` - the array element value.
      `cpool` - the constant pool generator.
      `copyPoolEntries` - whether to copy pool entries.

  - ### ArrayElementValueGen

    public ArrayElementValueGen(ConstantPoolGen cp)
    Constructs an ArrayElementValueGen.
    Parameters:
      `cp` - the constant pool generator.

  - ### ArrayElementValueGen

    public ArrayElementValueGen(int type, ElementValue[] elementValues, ConstantPoolGen cpool)
    Constructs an ArrayElementValueGen.
    Parameters:
      `type` - the type.
      `elementValues` - the element values.
      `cpool` - the constant pool generator.

- ## Method Details

  - ### addElement

    public void addElement(ElementValueGen gen)
    Adds an element.
    Parameters:
      `gen` - the element value generator.

  - ### dump

    public void dump(DataOutputStream dos) throws IOException
    Description copied from class: `ElementValueGen`
    Dumps this element value to a DataOutputStream.
    Specified by:
      `dump` in class `ElementValueGen`
    Parameters:
      `dos` - the output stream.
    Throws:
      `IOException` - if an I/O error occurs.

  - ### getElementValue

    public ElementValue getElementValue()
    Return immutable variant of this ArrayElementValueGen.
    Specified by:
      `getElementValue` in class `ElementValueGen`
    Returns:
      immutable variant of this ArrayElementValueGen.

  - ### getElementValues

    public List<ElementValueGen> getElementValues()
    Gets the element values.
    Returns:
      the element values.

  - ### getElementValuesSize

    public int getElementValuesSize()
    Gets the element values size.
    Returns:
      the element values size.

  - ### stringifyValue

    public String stringifyValue()
    Description copied from class: `ElementValueGen`
    Returns a string representation of the element value.
    Specified by:
      `stringifyValue` in class `ElementValueGen`
    Returns:
      a string representation of the element value.