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

public abstract Class ElementValue

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.tomcat.util.bcel.classfile.EnumElementValue, org.apache.tomcat.util.bcel.classfile.SimpleElementValue, org.apache.tomcat.util.bcel.classfile.AnnotationElementValue, org.apache.tomcat.util.bcel.classfile.ArrayElementValue, org.apache.tomcat.util.bcel.classfile.ClassElementValue
Imports
java.io.DataInput, .IOException, org.apache.tomcat.util.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;
}

Field Summary

Modifier and TypeField and Description
public static final byte
public static final byte
public static final byte
private final ConstantPool
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
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
ElementValue(final int type, final ConstantPool cpool)

Method Summary

Modifier and TypeMethod and Description
pack-priv final ConstantPool
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
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

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
private final ConstantPool cpool
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
private final int type

Constructor Detail

ElementValueback to summary
pack-priv ElementValue(final int type, final ConstantPool cpool)

Method Detail

getConstantPoolback to summary
pack-priv final ConstantPool getConstantPool()
getTypeback to summary
pack-priv final int getType()
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()