Package org.apache.bcel.generic
Class ArrayElementValueGen
- java.lang.Object
-
- org.apache.bcel.generic.ElementValueGen
-
- org.apache.bcel.generic.ArrayElementValueGen
-
public class ArrayElementValueGen extends ElementValueGen
Generates array element values in annotations.- Since:
- 6.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ElementValueGen>evalues-
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 Constructor Description ArrayElementValueGen(int type, ElementValue[] elementValues, ConstantPoolGen cpool)Constructs an ArrayElementValueGen.ArrayElementValueGen(ArrayElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)Constructs an ArrayElementValueGen.ArrayElementValueGen(ConstantPoolGen cp)Constructs an ArrayElementValueGen.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElement(ElementValueGen gen)Adds an element.voiddump(java.io.DataOutputStream dos)Dumps this element value to a DataOutputStream.ElementValuegetElementValue()Return immutable variant of this ArrayElementValueGen.java.util.List<ElementValueGen>getElementValues()Gets the element values.intgetElementValuesSize()Gets the element values size.java.lang.StringstringifyValue()Returns a string representation of the element value.-
Methods inherited from class org.apache.bcel.generic.ElementValueGen
copy, getConstantPool, getElementValueType, readElementValue
-
-
-
-
Field Detail
-
evalues
private final java.util.List<ElementValueGen> evalues
-
-
Constructor Detail
-
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
public ArrayElementValueGen(ConstantPoolGen cp)
Constructs an ArrayElementValueGen.- Parameters:
cp- the constant pool generator.
-
ArrayElementValueGen
public ArrayElementValueGen(int type, ElementValue[] elementValues, ConstantPoolGen cpool)Constructs an ArrayElementValueGen.- Parameters:
type- the type.elementValues- the element values.cpool- the constant pool generator.
-
-
Method Detail
-
addElement
public void addElement(ElementValueGen gen)
Adds an element.- Parameters:
gen- the element value generator.
-
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()
Return immutable variant of this ArrayElementValueGen.- Specified by:
getElementValuein classElementValueGen- Returns:
- immutable variant of this ArrayElementValueGen.
-
getElementValues
public java.util.List<ElementValueGen> getElementValues()
Gets the element values.- Returns:
- the element values.
-
getElementValuesSize
public int getElementValuesSize()
Gets the element values size.- Returns:
- the element values size.
-
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.
-
-