Class ElementValuePair

java.lang.Object
org.apache.bcel.classfile.ElementValuePair

public class ElementValuePair extends Object
An annotation's element value pair.
Since:
6.0
  • Field Details

    • EMPTY_ARRAY

      static final ElementValuePair[] EMPTY_ARRAY
    • elementValue

      private final ElementValue elementValue
    • constantPool

      private final ConstantPool constantPool
    • elementNameIndex

      private final int elementNameIndex
  • Constructor Details

    • ElementValuePair

      public ElementValuePair(int elementNameIndex, ElementValue elementValue, ConstantPool constantPool)
      Constructs an ElementValuePair.
      Parameters:
      elementNameIndex - The element name index.
      elementValue - The element value.
      constantPool - The constant pool.
  • Method Details

    • dump

      protected void dump(DataOutputStream dos) throws IOException
      Dumps this element value pair to a DataOutputStream.
      Parameters:
      dos - The output stream.
      Throws:
      IOException - Thrown if an I/O error occurs.
    • getNameIndex

      public int getNameIndex()
      Gets the name index.
      Returns:
      The name index.
    • getNameString

      public String getNameString()
      Gets the name string.
      Returns:
      The name string.
    • getValue

      public final ElementValue getValue()
      Gets the value.
      Returns:
      The element value.
    • toShortString

      public String toShortString()
      Gets a short string representation.
      Returns:
      A short string representation.