public class Utf8Constant extends Constant
Constant represents a UTF-8 constant in the constant pool.CLASS, DOUBLE, DYNAMIC, FIELDREF, FLOAT, INTEGER, INTERFACE_METHODREF, INVOKE_DYNAMIC, LONG, METHOD_HANDLE, METHOD_TYPE, METHODREF, MODULE, NAME_AND_TYPE, PACKAGE, PRIMITIVE_ARRAY, STRING, UTF8processingFlags, processingInfo| Constructor and Description |
|---|
Utf8Constant()
Creates an uninitialized Utf8Constant.
|
Utf8Constant(java.lang.String string)
Creates a Utf8Constant containing the given string.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Clazz clazz,
ConstantVisitor constantVisitor)
Accepts the given visitor.
|
boolean |
equals(java.lang.Object object) |
byte[] |
getBytes()
Returns the UTF-8 data as an array of bytes.
|
java.lang.String |
getString()
Returns the UTF-8 data as a String.
|
int |
getTag()
Returns the constant pool info tag that specifies the entry type.
|
int |
hashCode() |
boolean |
isCategory2()
Returns whether the constant is of category 2.
|
void |
setBytes(byte[] bytes)
Initializes the UTF-8 data with an array of bytes.
|
void |
setString(java.lang.String utf8String)
Initializes the UTF-8 data with a String.
|
java.lang.String |
toString() |
getProcessingFlags, getProcessingInfo, setProcessingFlags, setProcessingInfopublic Utf8Constant()
public Utf8Constant(java.lang.String string)
public void setBytes(byte[] bytes)
public byte[] getBytes()
public void setString(java.lang.String utf8String)
public java.lang.String getString()
public int getTag()
Constantpublic boolean isCategory2()
ConstantisCategory2 in class Constantpublic void accept(Clazz clazz, ConstantVisitor constantVisitor)
Constantpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object