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 386056 2006-03-15 11:31:56Z tcurdt $
accept, addAttributeReader, clone, copy, dump, getConstantPool, getLength, getNameIndex, getTag, readAttribute, removeAttributeReader, setConstantPool, setLength, setNameIndex, toString |
constantvalue_index
private int constantvalue_index
ConstantValue
(package private) ConstantValue(int name_index,
int length,
DataInputStream file,
ConstantPool constant_pool)
throws IOException Construct object from file stream.
name_index - Name index in constant poollength - Content length in bytesfile - Input streamconstant_pool - Array of constants
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)
constantvalue_index - the index info the constant pool of this constant value
toString
public final String toString()
- toString in interface Attribute
- String representation of constant value.