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 Modifier and Type Field Description private inttypeIdxprivate intvalueIdx-
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.IOExceptionDescription copied from class:ElementValueGenDumps this element value to a DataOutputStream.- Specified by:
dumpin classElementValueGen- Parameters:
dos- the output stream.- Throws:
java.io.IOException- 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.
-
-