Package org.apache.bcel.generic
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 Summary
-
Fields inherited from class org.apache.bcel.generic.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 protectedEnumElementValueGen(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.EnumElementValueGen(EnumElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)Constructs an EnumElementValueGen from an EnumElementValue.EnumElementValueGen(ObjectType t, java.lang.String value, ConstantPoolGen cpool)Constructs an EnumElementValueGen.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(java.io.DataOutputStream dos)Dumps this element value to a DataOutputStream.ElementValuegetElementValue()Returns immutable variant of this EnumElementValueGen.java.lang.StringgetEnumTypeString()Gets the enum type string.java.lang.StringgetEnumValueString()Gets the enum value string.intgetTypeIndex()Gets the type index.intgetValueIndex()Gets the value index.java.lang.StringstringifyValue()Returns a string representation of the element value.-
Methods inherited from class org.apache.bcel.generic.ElementValueGen
copy, getConstantPool, getElementValueType, readElementValue
-
-
-
-
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:ElementValueGenDumps this element value to a DataOutputStream.- Specified by:
dumpin classElementValueGen- Parameters:
dos- The output stream.- Throws:
java.io.IOException- Thrown if an I/O error occurs.
-
getElementValue
public ElementValue getElementValue()
Returns immutable variant of this EnumElementValueGen.- Specified by:
getElementValuein classElementValueGen- Returns:
- immutable variant.
-
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:ElementValueGenReturns a string representation of the element value.- Specified by:
stringifyValuein classElementValueGen- Returns:
- A string representation of the element value.
-
-