org.apache.bcel.classfile
Class ConstantClass
- Cloneable, ConstantObject, Node, Serializable
public final class ConstantClass
This class is derived from the abstract
Constant class
and represents a reference to a (external) class.
Version:
- M. Dahm
Constant
ConstantClass
public ConstantClass(int name_index)
name_index
- Name index in constant pool. Should refer to a
ConstantUtf8.
ConstantClass
public ConstantClass(ConstantClass 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
v
- Visitor object
dump
public final void dump(DataOutputStream file)
throws IOException
Dump constant class to file stream in binary format.
- dump in interface Constant
file
- Output file stream
getBytes
public String getBytes(ConstantPool cp)
- dereferenced string
getNameIndex
public final int getNameIndex()
- Name index in constant pool of class name.
setNameIndex
public final void setNameIndex(int name_index)
toString
public final String toString()
- toString in interface Constant
- String representation.