public interface ConstantPool
Modifier and Type | Method and Description |
---|---|
int |
length()
Returns the number of entries the constant pool.
|
void |
loadReferencedType(int cpi,
int opcode)
Ensures that the type referenced by the specified constant pool entry is loaded and
initialized.
|
JavaConstant |
lookupAppendix(int cpi,
int opcode)
Looks up the appendix at the specified index.
|
Object |
lookupConstant(int cpi)
Looks up a constant at the specified index.
|
JavaField |
lookupField(int cpi,
int opcode)
Looks up a reference to a field.
|
JavaMethod |
lookupMethod(int cpi,
int opcode)
Looks up a reference to a method.
|
Signature |
lookupSignature(int cpi)
Looks up a method signature.
|
JavaType |
lookupType(int cpi,
int opcode)
Looks up a reference to a type.
|
String |
lookupUtf8(int cpi)
Looks up an Utf8 string.
|
int length()
void loadReferencedType(int cpi, int opcode)
cpi
- the index of the constant pool entry that references the typeopcode
- the opcode of the instruction that references the typeJavaField lookupField(int cpi, int opcode)
opcode
is non-negative, then resolution checks
specific to the bytecode it denotes are performed if the field is already resolved. Should
any of these checks fail, an unresolved field reference is returned.cpi
- the constant pool indexopcode
- the opcode of the instruction for which the lookup is being performed or
-1
cpi
in this poolClassFormatError
- if the entry at cpi
is not a fieldJavaMethod lookupMethod(int cpi, int opcode)
opcode
is non-negative, then resolution checks
specific to the bytecode it denotes are performed if the method is already resolved. Should
any of these checks fail, an unresolved method reference is returned.cpi
- the constant pool indexopcode
- the opcode of the instruction for which the lookup is being performed or
-1
cpi
in this poolClassFormatError
- if the entry at cpi
is not a methodJavaType lookupType(int cpi, int opcode)
opcode
is non-negative, then resolution checks
specific to the bytecode it denotes are performed if the type is already resolved. Should any
of these checks fail, an unresolved type reference is returned.cpi
- the constant pool indexopcode
- the opcode of the instruction for which the lookup is being performed or
-1
String lookupUtf8(int cpi)
cpi
- the constant pool indexcpi
in this constant poolSignature lookupSignature(int cpi)
cpi
- the constant pool indexcpi
in this constant poolObject lookupConstant(int cpi)
cpi
- the constant pool indexConstant
or JavaType
instance representing the constant pool
entryJavaConstant lookupAppendix(int cpi, int opcode)
cpi
- the constant pool indexopcode
- the opcode of the instruction for which the lookup is being performed or
-1
null