# Class ClassElementValue

java.lang.Object
org.apache.bcel.classfile.ElementValue
org.apache.bcel.classfile.ClassElementValue

public class ClassElementValue extends ElementValue
Represents a class element value in an annotation.

Since:
  6.0

- ## Field Summary

  ### Fields inherited from class ElementValue

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClassElementValue(int type, int idx, ConstantPool cpool)`
  Constructs a ClassElementValue.

- ## Method Summary

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

  ### Methods inherited from class ElementValue

  `getElementValueType, readElementValue, readElementValue, toShortString, toString`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### ClassElementValue

    public ClassElementValue(int type, int idx, ConstantPool cpool)
    Constructs a ClassElementValue.
    Parameters:
      `type` - the type.
      `idx` - the index.
      `cpool` - the constant pool.

- ## Method Details

  - ### dump

    public void dump(DataOutputStream dos) throws IOException
    Description copied from class: `ElementValue`
    Dumps this element value to a DataOutputStream.
    Specified by:
      `dump` in class `ElementValue`
    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.

  - ### getIndex

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

  - ### stringifyValue

    public String stringifyValue()
    Description copied from class: `ElementValue`
    Returns a string representation of the element value.
    Specified by:
      `stringifyValue` in class `ElementValue`
    Returns:
      a string representation of the element value.