Package org.apache.bcel.classfile
Class ElementValue
java.lang.Object
org.apache.bcel.classfile.ElementValue
- Direct Known Subclasses:
AnnotationElementValue,ArrayElementValue,ClassElementValue,EnumElementValue,SimpleElementValue
The element_value structure is documented at https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.7.16.1
element_value {
u1 tag;
union {
u2 const_value_index;
{ u2 type_name_index;
u2 const_name_index;
} enum_const_value;
u2 class_info_index;
annotation annotation_value;
{ u2 num_values;
element_value values[num_values];
} array_value;
} value;
}
- Since:
- 6.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final byteprotected ConstantPoolDeprecated.(since 6.0) will be made private and final; do not access directly, use getter(package private) static final ElementValue[]static final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byteprotected intDeprecated.(since 6.0) will be made private and final; do not access directly, use getter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddump(DataOutputStream dos) (package private) final ConstantPoolint(package private) final intgetType()static ElementValuereadElementValue(DataInput input, ConstantPool cpool) Reads anelement_valueas anElementValue.static ElementValuereadElementValue(DataInput input, ConstantPool cpool, int arrayNesting) Reads anelement_valueas anElementValue.abstract StringtoString()
-
Field Details
-
STRING
public static final byte STRING- See Also:
-
ENUM_CONSTANT
public static final byte ENUM_CONSTANT- See Also:
-
CLASS
public static final byte CLASS- See Also:
-
ANNOTATION
public static final byte ANNOTATION- See Also:
-
ARRAY
public static final byte ARRAY- See Also:
-
PRIMITIVE_INT
public static final byte PRIMITIVE_INT- See Also:
-
PRIMITIVE_BYTE
public static final byte PRIMITIVE_BYTE- See Also:
-
PRIMITIVE_CHAR
public static final byte PRIMITIVE_CHAR- See Also:
-
PRIMITIVE_DOUBLE
public static final byte PRIMITIVE_DOUBLE- See Also:
-
PRIMITIVE_FLOAT
public static final byte PRIMITIVE_FLOAT- See Also:
-
PRIMITIVE_LONG
public static final byte PRIMITIVE_LONG- See Also:
-
PRIMITIVE_SHORT
public static final byte PRIMITIVE_SHORT- See Also:
-
PRIMITIVE_BOOLEAN
public static final byte PRIMITIVE_BOOLEAN- See Also:
-
EMPTY_ARRAY
-
type
Deprecated.(since 6.0) will be made private and final; do not access directly, use getter -
cpool
Deprecated.(since 6.0) will be made private and final; do not access directly, use getter
-
-
Constructor Details
-
ElementValue
-
-
Method Details
-
readElementValue
Reads anelement_valueas anElementValue.- Parameters:
input- Raw data input.cpool- Constant pool.- Returns:
- a new ElementValue.
- Throws:
IOException- if an I/O error occurs.
-
readElementValue
public static ElementValue readElementValue(DataInput input, ConstantPool cpool, int arrayNesting) throws IOException Reads anelement_valueas anElementValue.- Parameters:
input- Raw data input.cpool- Constant pool.arrayNesting- level of current array nesting.- Returns:
- a new ElementValue.
- Throws:
IOException- if an I/O error occurs.- Since:
- 6.7.0
-
dump
- Throws:
IOException
-
getConstantPool
- Since:
- 6.0
-
getElementValueType
public int getElementValueType() -
getType
final int getType()- Since:
- 6.0
-
stringifyValue
-
toShortString
-
toString
-