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 Details

  • 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 - Thrown 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.