org.apache.bcel.classfile
Class ConstantString
- Cloneable, ConstantObject, Node, Serializable
public final class ConstantString
This class is derived from the abstract
Constant class
and represents a reference to a String object.
$Id: ConstantString.java,v 1.2 2002/03/11 16:16:35 mdahm Exp $
ConstantString
public ConstantString(int string_index)
string_index
- Index of Constant_Utf8 in constant pool
ConstantString
public ConstantString(ConstantString c)
Initialize from another object.
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 Constant
dump
public final void dump(DataOutputStream file)
throws IOException
Dump constant field reference to file stream in binary format.
- dump in interface Constant
file
- Output file stream
getStringIndex
public final int getStringIndex()
- Index in constant pool of the string (ConstantUtf8).
setStringIndex
public final void setStringIndex(int string_index)