Class ArrayElementValueGen


  • public class ArrayElementValueGen
    extends ElementValueGen
    Generates array element values in annotations.
    Since:
    6.0
    • Constructor Detail

      • 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 Detail

      • addElement

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

        public void dump​(java.io.DataOutputStream dos)
                  throws java.io.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:
        java.io.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 java.util.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 java.lang.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.