public abstract class FieldOrMethod extends CPInstruction implements LoadClass
index
length, opcode
Modifier | Constructor and Description |
---|---|
(package private) |
FieldOrMethod()
Empty constructor needed for 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(ConstantPoolGen) 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)
Get the ObjectType of the method return or field.
|
java.lang.String |
getName(ConstantPoolGen cpg) |
ReferenceType |
getReferenceType(ConstantPoolGen cpg)
Return the reference type representing the class, interface,
or array class referenced by the instruction.
|
java.lang.String |
getSignature(ConstantPoolGen cpg) |
dump, getIndex, getType, initFromFile, setIndex, toString, toString
accept, consumeStack, copy, dispose, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, setLength, setOpcode, toString
FieldOrMethod()
protected FieldOrMethod(short opcode, int index)
index
- to constant poolpublic java.lang.String getSignature(ConstantPoolGen cpg)
public java.lang.String getName(ConstantPoolGen cpg)
@Deprecated public java.lang.String getClassName(ConstantPoolGen cpg)
getReferenceType(ConstantPoolGen)
method, which correctly distinguishes
between class types and array types.@Deprecated public ObjectType getClassType(ConstantPoolGen cpg)
public ReferenceType getReferenceType(ConstantPoolGen cpg)
cpg
- the ConstantPoolGen used to create the instructionpublic ObjectType getLoadClassType(ConstantPoolGen cpg)
getLoadClassType
in interface LoadClass
ClassGenException
- when the field is (or method returns) an array,