CONSTANT_UTF8_info constant, representing strings, in the
constant pool of a class file. This describes strings in the
Modified UTF-8 format.
The use of a Utf8Entry is represented by a String.
Conversions are through ConstantPoolBuilder#utf8Entry(String) and
stringValue().
Some uses of Utf8Entry represent field or method descriptor strings, symbolically
represented as ClassDesc or MethodTypeDesc, depending on
where a Utf8Entry appear. Entries representing such uses are created
with ConstantPoolBuilder#utf8Entry(ClassDesc) and ConstantPoolBuilder#utf8Entry(MethodTypeDesc), and they can be converted to
symbolic descriptors on a per-use-site basis, such as in AnnotationValue. and MethodModel#methodTypeSymbol().
Unlike most constant pool entries, a UTF-8 entry is of flexible length: it is
represented as an array structure, with an u2 for the data length in
bytes, followed by that number of bytes of Modified UTF-8 data. It can
represent at most 65535 bytes of data due to the physical restrictions of
u2.
CONSTANT_Utf8_info Structure
Modified UTF-8
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: whether this entry describes the same string as the provided stringthe string to compare to s)Returns whether this entry describes the same string as the provided string. |
| public boolean | Returns: whether this entry describes the descriptor string of this field typethe field type desc)Returns whether this entry describes the descriptor string of this field type. |
| public boolean | Returns: whether this entry describes the descriptor string of this method typethe method type desc)Returns whether this entry describes the descriptor string of this method type. |
| public String |
| equalsString | back to summary |
|---|---|
| public boolean equalsString(String s) Returns whether this entry describes the same string as the provided string.
| |
| isFieldType | back to summary |
|---|---|
| public boolean isFieldType(ClassDesc desc) Returns whether this entry describes the descriptor string of this field type.
| |
| isMethodType | back to summary |
|---|---|
| public boolean isMethodType(MethodTypeDesc desc) Returns whether this entry describes the descriptor string of this method type.
| |
| stringValue | back to summary |
|---|---|
| public String stringValue() Returns the string value for this entry. API Note A
| |