Class ArrayElementValueGen
java.lang.Object
org.apache.bcel.generic.ElementValueGen
org.apache.bcel.generic.ArrayElementValueGen
Generates array 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
ConstructorsConstructorDescriptionArrayElementValueGen(int type, ElementValue[] elementValues, ConstantPoolGen cpool) Constructs an ArrayElementValueGen.ArrayElementValueGen(ArrayElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries) Constructs an ArrayElementValueGen.Constructs an ArrayElementValueGen. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an element.voiddump(DataOutputStream dos) Dumps this element value to a DataOutputStream.Gets an immutable variant of this ArrayElementValueGen.Gets the element values.intGets the element values size.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
-
ArrayElementValueGen
public ArrayElementValueGen(ArrayElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries) Constructs an ArrayElementValueGen.- Parameters:
value- The array element value.cpool- The constant pool generator.copyPoolEntries- whether to copy pool entries.
-
ArrayElementValueGen
Constructs an ArrayElementValueGen.- Parameters:
cp- The constant pool generator.
-
ArrayElementValueGen
Constructs an ArrayElementValueGen.- Parameters:
type- The type.elementValues- The element values.cpool- The constant pool generator.
-
-
Method Details
-
addElement
Adds an element.- Parameters:
gen- The element value generator.
-
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 ArrayElementValueGen.- Specified by:
getElementValuein classElementValueGen- Returns:
- immutable variant of this ArrayElementValueGen.
-
getElementValues
Gets the element values.- Returns:
- The element values.
-
getElementValuesSize
-
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.
-