org.apache.bcel.classfile
Class ConstantValue
- Cloneable, Node, Serializable
public final class ConstantValue
This class is derived from Attribute and represents a constant
value, i.e., a default value for initializing a class field.
This class is instantiated by the Attribute.readAttribute() method.
$Id: ConstantValue.java,v 1.5 2003/02/13 11:18:23 enver Exp $
accept , addAttributeReader , clone , copy , dump , getConstantPool , getLength , getNameIndex , getTag , readAttribute , removeAttributeReader , setConstantPool , setLength , setNameIndex , toString |
ConstantValue
public ConstantValue(int name_index,
int length,
int constantvalue_index,
ConstantPool constant_pool)
name_index
- Name index in constant poollength
- Content length in bytesconstantvalue_index
- Index in constant poolconstant_pool
- Array of constants
ConstantValue
public ConstantValue(ConstantValue c)
Initialize from another object. Note that both objects use the same
references (shallow copy). Use clone() for a physical copy.
accept
public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. I.e., the hierarchy of methods,
fields, attributes, etc. spawns a tree of objects.
- accept in interface Node
- accept in interface Attribute
dump
public final void dump(DataOutputStream file)
throws IOException
Dump constant value attribute to file stream on binary format.
- dump in interface Attribute
file
- Output file stream
getConstantValueIndex
public final int getConstantValueIndex()
- Index in constant pool of constant value.
setConstantValueIndex
public final void setConstantValueIndex(int constantvalue_index)
toString
public final String toString()
- toString in interface Attribute
- String representation of constant value.