# Class ClassElementValueGen

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

public class ClassElementValueGen extends ElementValueGen
Generates class element values in annotations.

Since:
  6.0

- ## Field Summary

  ### Fields inherited from class ElementValueGen

  `ANNOTATION, ARRAY, CLASS, cpGen, ENUM_CONSTANT, PRIMITIVE_BOOLEAN, PRIMITIVE_BYTE, PRIMITIVE_CHAR, PRIMITIVE_DOUBLE, PRIMITIVE_FLOAT, PRIMITIVE_INT, PRIMITIVE_LONG, PRIMITIVE_SHORT, STRING, type`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ClassElementValueGen(int typeIdx, ConstantPoolGen cpool)`
  Constructs a ClassElementValueGen.
  ``
  `ClassElementValueGen(ClassElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  Constructs a ClassElementValueGen.
  ``
  `ClassElementValueGen(ObjectType t, ConstantPoolGen cpool)`
  Constructs a ClassElementValueGen.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dump(DataOutputStream dos)`
  Dumps this element value to a DataOutputStream.
  `String`
  `getClassString()`
  Gets the class string.
  `ElementValue`
  `getElementValue()`
  Return immutable variant of this ClassElementValueGen.
  `int`
  `getIndex()`
  Gets the index.
  `String`
  `stringifyValue()`
  Returns a string representation of the element value.

  ### Methods inherited from class ElementValueGen

  `copy, getConstantPool, getElementValueType, readElementValue`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### ClassElementValueGen

    public ClassElementValueGen(ClassElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)
    Constructs a ClassElementValueGen.
    Parameters:
      `value` - the class element value.
      `cpool` - the constant pool generator.
      `copyPoolEntries` - whether to copy pool entries.

  - ### ClassElementValueGen

    protected ClassElementValueGen(int typeIdx, ConstantPoolGen cpool)
    Constructs a ClassElementValueGen.
    Parameters:
      `typeIdx` - the type index.
      `cpool` - the constant pool generator.

  - ### ClassElementValueGen

    public ClassElementValueGen(ObjectType t, ConstantPoolGen cpool)
    Constructs a ClassElementValueGen.
    Parameters:
      `t` - the object type.
      `cpool` - the constant pool generator.

- ## Method Details

  - ### 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` - if an I/O error occurs.

  - ### getClassString

    public String getClassString()
    Gets the class string.
    Returns:
      the class string.

  - ### getElementValue

    public ElementValue getElementValue()
    Return immutable variant of this ClassElementValueGen.
    Specified by:
      `getElementValue` in class `ElementValueGen`
    Returns:
      immutable variant of this ClassElementValueGen.

  - ### getIndex

    public int getIndex()
    Gets the index.
    Returns:
      the index.

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