Top Description Fields Constructors Methods
org.apache.bcel.classfile

public abstract Class ElementValue

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.bcel.classfile.EnumElementValue, org.apache.bcel.classfile.SimpleElementValue, org.apache.bcel.classfile.AnnotationElementValue, org.apache.bcel.classfile.ArrayElementValue, org.apache.bcel.classfile.ClassElementValue
Imports
java.io.DataInput, .DataOutputStream, .IOException, org.apache.bcel.Const

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

Modifier and TypeField and Description
public static final byte
public static final byte
public static final byte
protected ConstantPool
cpool

Deprecated (since 6.0) will be made private and final; do not access directly, use getter
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
protected int
type

Deprecated (since 6.0) will be made private and final; do not access directly, use getter

Constructor Summary

AccessConstructor and Description
protected
ElementValue(final int type, final ConstantPool cpool)

Method Summary

Modifier and TypeMethod and Description
public abstract void
pack-priv final ConstantPool
public int
pack-priv final int
public static ElementValue

Returns:

a new ElementValue.
readElementValue
(final DataInput
Raw data input.
input
,
final ConstantPool
Constant pool.
cpool
)

Reads an element_value as an ElementValue.

public static ElementValue

Returns:

a new ElementValue.
readElementValue
(final DataInput
Raw data input.
input
,
final ConstantPool
Constant pool.
cpool
,
int
level of current array nesting.
arrayNesting
)

Reads an element_value as an ElementValue.

public abstract String
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ANNOTATIONback to summary
public static final byte ANNOTATION
ARRAYback to summary
public static final byte ARRAY
CLASSback to summary
public static final byte CLASS
cpoolback to summary
protected ConstantPool cpool

Deprecated

(since 6.0) will be made private and final; do not access directly, use getter

Annotations
@Deprecated
ENUM_CONSTANTback to summary
public static final byte ENUM_CONSTANT
PRIMITIVE_BOOLEANback to summary
public static final byte PRIMITIVE_BOOLEAN
PRIMITIVE_BYTEback to summary
public static final byte PRIMITIVE_BYTE
PRIMITIVE_CHARback to summary
public static final byte PRIMITIVE_CHAR
PRIMITIVE_DOUBLEback to summary
public static final byte PRIMITIVE_DOUBLE
PRIMITIVE_FLOATback to summary
public static final byte PRIMITIVE_FLOAT
PRIMITIVE_INTback to summary
public static final byte PRIMITIVE_INT
PRIMITIVE_LONGback to summary
public static final byte PRIMITIVE_LONG
PRIMITIVE_SHORTback to summary
public static final byte PRIMITIVE_SHORT
STRINGback to summary
public static final byte STRING
typeback to summary
protected int type

Deprecated

(since 6.0) will be made private and final; do not access directly, use getter

Annotations
@Deprecated

Constructor Detail

ElementValueback to summary
protected ElementValue(final int type, final ConstantPool cpool)

Method Detail

dumpback to summary
public abstract void dump(DataOutputStream dos) throws IOException
getConstantPoolback to summary
pack-priv final ConstantPool getConstantPool()
Since
6.0
getElementValueTypeback to summary
public int getElementValueType()
getTypeback to summary
pack-priv final int getType()
Since
6.0
readElementValueback to summary
public static ElementValue readElementValue(final DataInput input, final ConstantPool cpool) throws IOException

Reads an element_value as an ElementValue.

Parameters
input:DataInput

Raw data input.

cpool:ConstantPool

Constant pool.

Returns:ElementValue

a new ElementValue.

Exceptions
IOException:
if an I/O error occurs.
readElementValueback to summary
public static ElementValue readElementValue(final DataInput input, final ConstantPool cpool, int arrayNesting) throws IOException

Reads an element_value as an ElementValue.

Parameters
input:DataInput

Raw data input.

cpool:ConstantPool

Constant pool.

arrayNesting:int

level of current array nesting.

Returns:ElementValue

a new ElementValue.

Exceptions
IOException:
if an I/O error occurs.
Since
6.7.0
stringifyValueback to summary
public abstract String stringifyValue()
toShortStringback to summary
public String toShortString()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override