public final class ConstantString extends Constant implements ConstantObject
Constant and represents a reference to a String object.Constant| Constructor and Description |
|---|
ConstantString(ConstantString c)
Initialize from another object.
|
ConstantString(int stringIndex) |
| 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)
Dump constant field reference to file stream in binary format.
|
String |
getBytes(ConstantPool cp) |
Object |
getConstantValue(ConstantPool cp) |
int |
getStringIndex() |
void |
setStringIndex(int stringIndex) |
String |
toString() |
clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparatorpublic ConstantString(ConstantString c)
public ConstantString(int stringIndex)
stringIndex - Index of Constant_Utf8 in constant poolpublic void accept(Visitor v)
public void dump(DataOutputStream file) throws IOException
dump in class Constantfile - Output file streamIOException - if an I/O error occurs.public String getBytes(ConstantPool cp)
public Object getConstantValue(ConstantPool cp)
getConstantValue in interface ConstantObjectpublic int getStringIndex()
public void setStringIndex(int stringIndex)
stringIndex - the index into the constant of the string valueCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.