Class ElementValueGen
java.lang.Object
org.apache.bcel.generic.ElementValueGen
- Direct Known Subclasses:
AnnotationElementValueGen, ArrayElementValueGen, ClassElementValueGen, EnumElementValueGen, SimpleElementValueGen
Generates element values in annotations.
- Since:
- 6.0
-
Field Summary
FieldsModifier 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
ConstructorsModifierConstructorDescriptionprotectedElementValueGen(int type, ConstantPoolGen cpGen) Constructs an ElementValueGen. -
Method Summary
Modifier and TypeMethodDescriptionstatic ElementValueGencopy(ElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries) Creates an (modifiable) ElementValueGen copy of an (immutable) ElementValue - constant pool is assumed correct.abstract voiddump(DataOutputStream dos) Dumps this element value to a DataOutputStream.protected ConstantPoolGenGets the constant pool.abstract ElementValueSubtypes return an immutable variant of the ElementValueGen.intGets the element value type.static ElementValueGenreadElementValue(DataInput dis, ConstantPoolGen cpGen) Reads an element value from a DataInput.abstract StringReturns a string representation of the element value.
-
Field Details
-
STRING
-
ENUM_CONSTANT
-
CLASS
-
ANNOTATION
-
ARRAY
-
PRIMITIVE_INT
-
PRIMITIVE_BYTE
-
PRIMITIVE_CHAR
-
PRIMITIVE_DOUBLE
-
PRIMITIVE_FLOAT
-
PRIMITIVE_LONG
-
PRIMITIVE_SHORT
-
PRIMITIVE_BOOLEAN
-
type
Deprecated.(since 6.0) will be made private and final; do not access directly, use getter -
cpGen
Deprecated.(since 6.0) will be made private and final; do not access directly, use getter
-
-
Constructor Details
-
ElementValueGen
Constructs an ElementValueGen.- Parameters:
type- the element value type.cpGen- the constant pool.
-
-
Method Details
-
copy
public static ElementValueGen copy(ElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries) Creates an (modifiable) ElementValueGen copy of an (immutable) ElementValue - constant pool is assumed correct.- Parameters:
value- the element value to copy.cpool- the constant pool generator.copyPoolEntries- whether to copy pool entries.- Returns:
- a copy of the element value.
-
readElementValue
public static ElementValueGen readElementValue(DataInput dis, ConstantPoolGen cpGen) throws IOException Reads an element value from a DataInput.- Parameters:
dis- the data input stream.cpGen- the constant pool.- Returns:
- the element value read.
- Throws:
IOException- if an I/O error occurs.
-
dump
Dumps this element value to a DataOutputStream.- Parameters:
dos- the output stream.- Throws:
IOException- if an I/O error occurs.
-
getConstantPool
-
getElementValue
Subtypes return an immutable variant of the ElementValueGen.- Returns:
- an immutable variant of the ElementValueGen.
-
getElementValueType
-
stringifyValue
Returns a string representation of the element value.- Returns:
- a string representation of the element value.
-