Class EnumElementValueGen
java.lang.Object
org.apache.bcel.generic.ElementValueGen
org.apache.bcel.generic.EnumElementValueGen
Generates enum element values in annotations.
- Since:
- 6.0
-
Field Summary
Fields inherited from class 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
ConstructorsModifierConstructorDescriptionprotectedEnumElementValueGen(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, String value, ConstantPoolGen cpool) Constructs an EnumElementValueGen. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(DataOutputStream dos) Dumps this element value to a DataOutputStream.Returns immutable variant of this EnumElementValueGen.Gets the enum type string.Gets the enum value string.intGets the type index.intGets the value index.Returns a string representation of the element value.Methods inherited from class ElementValueGen
copy, getConstantPool, getElementValueType, readElementValue
-
Constructor Details
-
EnumElementValueGen
Constructs an EnumElementValueGen from an EnumElementValue.- Parameters:
value- the enum element value.cpool- the constant pool.copyPoolEntries- whether to copy pool entries.
-
EnumElementValueGen
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
Constructs an EnumElementValueGen.- Parameters:
t- the object type.value- the value.cpool- the constant pool.
-
-
Method Details
-
dump
Description copied from class:ElementValueGenDumps this element value to a DataOutputStream.- Specified by:
dumpin classElementValueGen- Parameters:
dos- the output stream.- Throws:
IOException- if an I/O error occurs.
-
getElementValue
Returns immutable variant of this EnumElementValueGen.- Specified by:
getElementValuein classElementValueGen- Returns:
- immutable variant.
-
getEnumTypeString
-
getEnumValueString
-
getTypeIndex
-
getValueIndex
-
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.
-