Class EnumElementValueGen


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

      • typeIdx

        private final int typeIdx
      • valueIdx

        private final int valueIdx
    • Constructor Detail

      • 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,
                                   java.lang.String value,
                                   ConstantPoolGen cpool)
        Constructs an EnumElementValueGen.
        Parameters:
        t - the object type.
        value - the value.
        cpool - the constant pool.
    • Method Detail

      • dump

        public void dump​(java.io.DataOutputStream dos)
                  throws java.io.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:
        java.io.IOException - if an I/O error occurs.
      • getEnumTypeString

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

        public java.lang.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 java.lang.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.