public abstract class FieldOrMethod extends NameSignatureInstruction implements LoadClass
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
index
length, opcode
Modifier | Constructor and Description |
---|---|
(package private) |
FieldOrMethod()
Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction().
|
protected |
FieldOrMethod(short opcode,
int index) |
Modifier and Type | Method and Description |
---|---|
java.lang.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, dispose, equals, getComparator, getLength, getName, getOpcode, hashCode, produceStack, readInstruction, setComparator, toString
private static final long serialVersionUID
FieldOrMethod()
protected FieldOrMethod(short opcode, int index)
index
- to constant pool@Deprecated public java.lang.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