public abstract class FieldOrMethod extends NameSignatureInstruction implements LoadClass
index
length, opcode
Modifier | Constructor and Description |
---|---|
protected |
FieldOrMethod(short opcode,
int index) |
Modifier and Type | Method and Description |
---|---|
String |
getClassName(ConstantPoolGen cpg)
Deprecated.
If the instruction references an array class,
this method will return "java.lang.Object".
For code generated by Java 1.5, this answer is
sometimes wrong (e.g., if the "clone()" method is
called on an array). A better idea is to use
the getReferenceType() method, which correctly distinguishes
between class types and array types.
|
ObjectType |
getClassType(ConstantPoolGen cpg)
Deprecated.
If the instruction references an array class,
the ObjectType returned will be invalid. Use
getReferenceType() instead.
|
ObjectType |
getLoadClassType(ConstantPoolGen cpg)
Returns the ObjectType of the referenced class or interface
that may be loaded and resolved.
|
ReferenceType |
getReferenceType(ConstantPoolGen cpg)
Return the reference type representing the class, interface,
or array class referenced by the instruction.
|
getName, getNameAndType, getSignature
dump, getIndex, getType, initFromFile, setIndex, toString, toString
accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, produceStack, readInstruction, setComparator, toString
protected FieldOrMethod(short opcode, int index)
index
- to constant pool@Deprecated public String getClassName(ConstantPoolGen cpg)
@Deprecated public ObjectType getClassType(ConstantPoolGen cpg)
public ReferenceType getReferenceType(ConstantPoolGen cpg)
cpg
- the ConstantPoolGen used to create the instructionpublic ObjectType getLoadClassType(ConstantPoolGen cpg)
LoadClass
getLoadClassType
in interface LoadClass