Class EnumElementValueGen

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

public class EnumElementValueGen extends ElementValueGen
Generates enum element values in annotations.
Since:
6.0
  • Field Details

    • typeIdx

      private final int typeIdx
    • valueIdx

      private final int valueIdx
  • Constructor Details

    • EnumElementValueGen

      public EnumElementValueGen(EnumElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)
      Constructs an EnumElementValueGen from an EnumElementValue.
      Parameters:
      value - The enum element value.
      cpool - The constant pool.
      copyPoolEntries - whether to copy pool entries.
    • EnumElementValueGen

      protected EnumElementValueGen(int typeIdx, int valueIdx, ConstantPoolGen cpool)
      This constructor assumes the constant pool already contains the right type and value - as indicated by typeIdx and valueIdx. This constructor is used for deserialization.
      Parameters:
      typeIdx - The type index.
      valueIdx - The value index.
      cpool - The constant pool.
    • EnumElementValueGen

      public EnumElementValueGen(ObjectType t, String value, ConstantPoolGen cpool)
      Constructs an EnumElementValueGen.
      Parameters:
      t - The object type.
      value - The value.
      cpool - The constant pool.
  • 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 - Thrown if an I/O error occurs.
    • getElementValue

      public ElementValue getElementValue()
      Returns immutable variant of this EnumElementValueGen.
      Specified by:
      getElementValue in class ElementValueGen
      Returns:
      immutable variant.
    • getEnumTypeString

      public String getEnumTypeString()
      Gets the enum type string.
      Returns:
      The enum type string.
    • getEnumValueString

      public String getEnumValueString()
      Gets the enum value string.
      Returns:
      The enum value string.
    • getTypeIndex

      public int getTypeIndex()
      Gets the type index.
      Returns:
      The type index.
    • getValueIndex

      public int getValueIndex()
      Gets the value index.
      Returns:
      The value 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.