public final class ConstantClass extends Constant implements ConstantObject
Constant and represents a reference to a (external) class.Constant| Constructor and Description |
|---|
ConstantClass(ConstantClass c)
Initialize from another object.
|
ConstantClass(int nameIndex) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
|
void |
dump(DataOutputStream file)
Dumps constant class to file stream in binary format.
|
String |
getBytes(ConstantPool cp) |
Object |
getConstantValue(ConstantPool cp) |
int |
getNameIndex() |
void |
setNameIndex(int nameIndex) |
String |
toString() |
clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparatorpublic ConstantClass(ConstantClass c)
public ConstantClass(int nameIndex)
nameIndex - Name index in constant pool. Should refer to a ConstantUtf8.public void accept(Visitor v)
public void dump(DataOutputStream file) throws IOException
dump in class Constantfile - Output file streamIOException - if an I/O error occurs writing to the DataOutputStream.public String getBytes(ConstantPool cp)
public Object getConstantValue(ConstantPool cp)
getConstantValue in interface ConstantObjectpublic int getNameIndex()
public void setNameIndex(int nameIndex)
nameIndex - the name index in the constant pool of this Constant ClassCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.