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, UTF8
processingFlags, 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() |
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo
public 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()
Constant
public boolean isCategory2()
Constant
isCategory2
in class Constant
public void accept(Clazz clazz, ConstantVisitor constantVisitor)
Constant
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object