|
TechTrader Bytecode Toolkit | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.techtrader.modules.tools.bytecode.Instruction | +--com.techtrader.modules.tools.bytecode.MethodInstruction
Represents an instruction that takes as an argument a method to operate on. Examples include INVOKEINTERFACE, INVOKEVIRTUAL, etc.
Fields inherited from class com.techtrader.modules.tools.bytecode.Instruction |
_byteIndex,
_opcode,
_opcodeTypes,
_owner |
Constructor Summary | |
protected |
MethodInstruction(Code owner,
int opcode)
|
Method Summary | |
void |
acceptVisit(BCVisitor visit)
Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object. |
protected void |
copy(Instruction orig)
|
boolean |
equals(Object other)
Method instructions are equal if the method of either is unset, or if they refer to the same method. |
int |
getLength()
Return the length in bytes of this opcode, including all arguments. |
BCMethod |
getMethod()
If the method is a member of the current class, then this method will retrieve the BCMethod object for it; otherwise it will return null. |
int |
getMethodIndex()
Get the index of the ComplexEntry in the constant pool describing the method to operate on. |
String |
getMethodName()
Get the nam of the method to operate on. |
Class |
getMethodOwnerType()
Get the type of the method. |
String |
getMethodOwnerTypeName()
Get the type of the method. |
String[] |
getMethodParamTypeNames()
Get the param types of the method. |
Class[] |
getMethodParamTypes()
Get the param types of the method. |
Class |
getMethodReturnType()
Get the return type of the method. |
String |
getMethodReturnTypeName()
Get the return type of the method. |
int |
getStackChange()
Return the number of stack positions this instruction pushes or pops during its execution. |
boolean |
isMethodInCurrentClass()
Return true if the method is a member of the current class. |
protected void |
readData(DataInput in)
Read the arguments for this opcode from the given stream. |
MethodInstruction |
setMethod(BCMethod method)
Set the method to operate on. |
MethodInstruction |
setMethod(Constructor method)
Set the method to operate on. |
MethodInstruction |
setMethod(Method method)
Set the method to operate on. |
MethodInstruction |
setMethod(String name,
Class returnType,
Class[] paramTypes,
Class ownerType)
Set the method to operate on. |
MethodInstruction |
setMethod(String name,
Class returnType,
Class[] paramTypes,
String ownerType)
Set the method to operate on. |
MethodInstruction |
setMethod(String name,
String returnType,
String[] paramTypes,
String ownerType)
Set the method to operate on. |
void |
setMethodIndex(int index)
Set the index of the ComplexEntry in the constant pool describing the method to operate on. |
MethodInstruction |
setMethodName(String name)
Change the method name. |
MethodInstruction |
setMethodOwnerTypeName(String name)
Change the method owner type. |
MethodInstruction |
setMethodParamTypeNames(String[] names)
Change the method param types. |
MethodInstruction |
setMethodReturnTypeName(String name)
Change the method return type. |
protected void |
writeData(DataOutput out)
Write the arguments for this opcode to the given stream. |
Methods inherited from class com.techtrader.modules.tools.bytecode.Instruction |
getByteIndex,
getName,
getOpCode,
getOwner,
invalidate,
setByteIndex,
setOpCode |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
protected MethodInstruction(Code owner, int opcode)
Method Detail |
public int getMethodIndex()
public void setMethodIndex(int index)
public MethodInstruction setMethod(BCMethod method)
public MethodInstruction setMethod(Method method)
public MethodInstruction setMethod(Constructor method)
public MethodInstruction setMethod(String name, String returnType, String[] paramTypes, String ownerType)
public MethodInstruction setMethod(String name, Class returnType, Class[] paramTypes, String ownerType)
public MethodInstruction setMethod(String name, Class returnType, Class[] paramTypes, Class ownerType)
public MethodInstruction setMethodName(String name)
public MethodInstruction setMethodOwnerTypeName(String name)
public MethodInstruction setMethodReturnTypeName(String name)
public MethodInstruction setMethodParamTypeNames(String[] names)
public boolean isMethodInCurrentClass()
public BCMethod getMethod()
public String getMethodName()
public String getMethodReturnTypeName()
public Class getMethodReturnType() throws ClassNotFoundException
public String[] getMethodParamTypeNames()
public Class[] getMethodParamTypes() throws ClassNotFoundException
public String getMethodOwnerTypeName()
public Class getMethodOwnerType() throws ClassNotFoundException
public boolean equals(Object other)
public int getLength()
public int getStackChange()
protected void copy(Instruction orig)
protected void readData(DataInput in) throws IOException
protected void writeData(DataOutput out) throws IOException
public void acceptVisit(BCVisitor visit)
|
TechTrader Bytecode Toolkit | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |