Class ElementValueGen

    • Constructor Detail

      • ElementValueGen

        protected ElementValueGen​(int type,
                                  ConstantPoolGen cpGen)
        Constructs an ElementValueGen.
        Parameters:
        type - The element value type.
        cpGen - The constant pool.
    • Method Detail

      • copy

        public static ElementValueGen copy​(ElementValue value,
                                           ConstantPoolGen cpool,
                                           boolean copyPoolEntries)
        Creates an (modifiable) ElementValueGen copy of an (immutable) ElementValue - constant pool is assumed correct.
        Parameters:
        value - The element value to copy.
        cpool - The constant pool generator.
        copyPoolEntries - whether to copy pool entries.
        Returns:
        A copy of the element value.
      • readElementValue

        public static ElementValueGen readElementValue​(java.io.DataInput dis,
                                                       ConstantPoolGen cpGen)
                                                throws java.io.IOException
        Reads an element value from a DataInput.
        Parameters:
        dis - The data input stream.
        cpGen - The constant pool.
        Returns:
        The element value read.
        Throws:
        java.io.IOException - Thrown if an I/O error occurs.
      • dump

        public abstract void dump​(java.io.DataOutputStream dos)
                           throws java.io.IOException
        Dumps this element value to a DataOutputStream.
        Parameters:
        dos - The output stream.
        Throws:
        java.io.IOException - Thrown if an I/O error occurs.
      • getElementValue

        public abstract ElementValue getElementValue()
        Subtypes return an immutable variant of the ElementValueGen.
        Returns:
        An immutable variant of the ElementValueGen.
      • getElementValueType

        public int getElementValueType()
        Gets the element value type.
        Returns:
        The element value type.
      • stringifyValue

        public abstract java.lang.String stringifyValue()
        Returns a string representation of the element value.
        Returns:
        A string representation of the element value.