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, type -
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.Return 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, readElementValue
-
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- if an I/O error occurs.
-
getElementValue
Return 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.
-