CONSTANT_Class_info structure, representing a reference
type, in the constant pool of a class file.
The use of a ClassEntry is modeled by a ClassDesc that is not
primitive. Conversions are through ConstantPoolBuilder#classEntry(
ClassDesc) and asSymbol().
A ClassEntry is composite:
ClassEntry(Utf8Entry name)
name represents:
ClassEntry represents a class or interface, such as java/lang/String for the String class.
ClassEntry represents an array type, such as
[I for the int[] type, or [Ljava/lang/String; for the
String[] type.
'[' character.
API Note
The internal form of a binary name, where all occurrences of . in the
name are replaced by /, is informally known as an internal name. This concept also applies to package names in
addition to class and interface names.
CONSTANT_Class_info Structure
ConstantPoolBuilder::classEntry, ClassDesc
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the represented reference type, as the internal form of a binary name or an array descriptor stringReturns the represented reference type, as the internal form of a binary name or an array descriptor string. |
| public ClassDesc | Returns: the represented reference type, as a symbolic descriptorReturns the represented reference type, as a symbolic descriptor. |
| public default ConstantDesc | constantValue()
Implements java. Returns a symbolic descriptor of this constant. |
| public boolean | |
| public Utf8Entry | Returns: theUtf8Entry referred by this structureReturns the |
| asInternalName | back to summary |
|---|---|
| public String asInternalName() Returns the represented reference type, as the internal form of a binary name or an array descriptor
string. This is a shortcut for
| |
| asSymbol | back to summary |
|---|---|
| public ClassDesc asSymbol() Returns the represented reference type, as a symbolic descriptor. The returned descriptor is never primitive. API Note If only symbol equivalence is desired,
| |
| constantValue | back to summary |
|---|---|
| public default ConstantDesc constantValue() Implements java. Doc from java. Returns a symbolic descriptor of this constant.
This is equivalent to
| |
| matches | back to summary |
|---|---|
| public boolean matches(ClassDesc desc) Returns whether this entry describes the given reference type. Returns
| |
| name | back to summary |
|---|---|
| public Utf8Entry name() Returns the
| |