# Class ElementValueGen

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

Direct Known Subclasses:
  `AnnotationElementValueGen, ArrayElementValueGen, ClassElementValueGen, EnumElementValueGen, SimpleElementValueGen`

public abstract class ElementValueGen extends Object

Since:
  6.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ANNOTATION`
  `static final int`
  `ARRAY`
  `static final int`
  `CLASS`
  `protected ConstantPoolGen`
  `cpGen`
  Deprecated.
  (since 6.0) will be made private and final; do not access directly, use getter
  `static final int`
  `ENUM_CONSTANT`
  `static final int`
  `PRIMITIVE_BOOLEAN`
  `static final int`
  `PRIMITIVE_BYTE`
  `static final int`
  `PRIMITIVE_CHAR`
  `static final int`
  `PRIMITIVE_DOUBLE`
  `static final int`
  `PRIMITIVE_FLOAT`
  `static final int`
  `PRIMITIVE_INT`
  `static final int`
  `PRIMITIVE_LONG`
  `static final int`
  `PRIMITIVE_SHORT`
  `static final int`
  `STRING`
  `protected int`
  `type`
  Deprecated.
  (since 6.0) will be made private and final; do not access directly, use getter

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ElementValueGen(int type, ConstantPoolGen cpGen)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ElementValueGen`
  `copy(ElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  Creates an (modifiable) ElementValueGen copy of an (immutable) ElementValue - constant pool is assumed correct.
  `abstract void`
  `dump(DataOutputStream dos)`
  `protected ConstantPoolGen`
  `getConstantPool()`
  `abstract ElementValue`
  `getElementValue()`
  Subtypes return an immutable variant of the ElementValueGen
  `int`
  `getElementValueType()`
  `static ElementValueGen`
  `readElementValue(DataInput dis, ConstantPoolGen cpGen)`
  `abstract String`
  `stringifyValue()`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### STRING

    public static final int STRING
    See Also:
      - Constant Field Values

  - ### ENUM_CONSTANT

    public static final int ENUM_CONSTANT
    See Also:
      - Constant Field Values

  - ### CLASS

    public static final int CLASS
    See Also:
      - Constant Field Values

  - ### ANNOTATION

    public static final int ANNOTATION
    See Also:
      - Constant Field Values

  - ### ARRAY

    public static final int ARRAY
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_INT

    public static final int PRIMITIVE_INT
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_BYTE

    public static final int PRIMITIVE_BYTE
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_CHAR

    public static final int PRIMITIVE_CHAR
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_DOUBLE

    public static final int PRIMITIVE_DOUBLE
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_FLOAT

    public static final int PRIMITIVE_FLOAT
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_LONG

    public static final int PRIMITIVE_LONG
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_SHORT

    public static final int PRIMITIVE_SHORT
    See Also:
      - Constant Field Values

  - ### PRIMITIVE_BOOLEAN

    public static final int 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 Details

  - ### ElementValueGen

    protected ElementValueGen(int type, ConstantPoolGen cpGen)

- ## Method Details

  - ### 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.

  - ### readElementValue

    public static ElementValueGen readElementValue(DataInput dis, ConstantPoolGen cpGen) throws IOException
    Throws:
      `IOException`

  - ### dump

    public abstract void dump(DataOutputStream dos) throws IOException
    Throws:
      `IOException`

  - ### getConstantPool

    protected ConstantPoolGen getConstantPool()

  - ### getElementValue

    public abstract ElementValue getElementValue()
    Subtypes return an immutable variant of the ElementValueGen

  - ### getElementValueType

    public int getElementValueType()

  - ### stringifyValue

    public abstract String stringifyValue()