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, typeModifier and TypeFieldDescriptionstatic final intElement value type: annotation.static final intElement value type: array.static final intElement value type: class.protected ConstantPoolGenDeprecated.(since 6.0) will be made private and final; do not access directly, use getterstatic final intElement value type: enum constant.static final intElement value type: primitive boolean.static final intElement value type: primitive byte.static final intElement value type: primitive char.static final intElement value type: primitive double.static final intElement value type: primitive float.static final intElement value type: primitive int.static final intElement value type: primitive long.static final intElement value type: primitive short.static final intElement value type: string.protected intDeprecated.(since 6.0) will be made private and final; do not access directly, use getter -
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.Gets an 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, readElementValueModifier and TypeMethodDescriptionstatic ElementValueGencopy(ElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries) Creates an (modifiable) ElementValueGen copy of an (immutable) ElementValue - constant pool is assumed correct.protected ConstantPoolGenGets the constant pool.intGets the element value type.static ElementValueGenreadElementValue(DataInput dis, ConstantPoolGen cpGen) Reads an element value from a DataInput.
-
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- Thrown if an I/O error occurs.
-
getElementValue
Gets an 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.
-