Class ElementValueGen

    • Field Detail

      • ENUM_CONSTANT

        public static final int ENUM_CONSTANT
        Element value type: enum constant.
        See Also:
        Constant Field Values
      • ANNOTATION

        public static final int ANNOTATION
        Element value type: annotation.
        See Also:
        Constant Field Values
      • PRIMITIVE_INT

        public static final int PRIMITIVE_INT
        Element value type: primitive int.
        See Also:
        Constant Field Values
      • PRIMITIVE_BYTE

        public static final int PRIMITIVE_BYTE
        Element value type: primitive byte.
        See Also:
        Constant Field Values
      • PRIMITIVE_CHAR

        public static final int PRIMITIVE_CHAR
        Element value type: primitive char.
        See Also:
        Constant Field Values
      • PRIMITIVE_DOUBLE

        public static final int PRIMITIVE_DOUBLE
        Element value type: primitive double.
        See Also:
        Constant Field Values
      • PRIMITIVE_FLOAT

        public static final int PRIMITIVE_FLOAT
        Element value type: primitive float.
        See Also:
        Constant Field Values
      • PRIMITIVE_LONG

        public static final int PRIMITIVE_LONG
        Element value type: primitive long.
        See Also:
        Constant Field Values
      • PRIMITIVE_SHORT

        public static final int PRIMITIVE_SHORT
        Element value type: primitive short.
        See Also:
        Constant Field Values
      • PRIMITIVE_BOOLEAN

        public static final int PRIMITIVE_BOOLEAN
        Element value type: primitive boolean.
        See Also:
        Constant Field Values
      • type

        @Deprecated
        protected int type
        Deprecated.
        (since 6.0) will be made private and final; do not access directly, use getter
      • cpGen

        @Deprecated
        protected ConstantPoolGen cpGen
        Deprecated.
        (since 6.0) will be made private and final; do not access directly, use getter
    • 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 - 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 - if an I/O error occurs.
      • getConstantPool

        protected ConstantPoolGen getConstantPool()
        Gets the constant pool.
        Returns:
        the constant pool.
      • 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.