|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectserp.bytecode.Instruction
serp.bytecode.MethodInstruction
public class MethodInstruction
An instruction that invokes a method.
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 one. |
boolean |
equalsInstruction(Instruction other)
MethodInstructions are equal if the method they reference is the same, or if the method of either is unset. |
int |
getLogicalStackChange()
Return the logical number of stack positions changed by this instruction. |
BCMethod |
getMethod()
Return the method this instruction operates on, or null if not set. |
BCClass |
getMethodDeclarerBC()
Return the declaring type of the method this instruction operates on, or null if not set. |
String |
getMethodDeclarerName()
Return the declaring type of the method this instruction operates on, or null if not set. |
Class |
getMethodDeclarerType()
Return the declaring type of the method this instruction operates on, or null if not set. |
int |
getMethodIndex()
Return the index in the class ConstantPool of the
ComplexEntry describing the method to operate on. |
String |
getMethodName()
Return the name of the method this instruction operates on, or null if not set. |
BCClass[] |
getMethodParamBCs()
Return the param types of the method this instruction operates on, or empty array if none. |
String[] |
getMethodParamNames()
Return the param types of the method this instruction operates on, or empty array if none. |
Class[] |
getMethodParamTypes()
Return the param types of the method this instruction operates on, or empty array if none. |
BCClass |
getMethodReturnBC()
Return the return type of the method this instruction operates on, or null if not set. |
String |
getMethodReturnName()
Return the return type of the method this instruction operates on, or null if not set. |
Class |
getMethodReturnType()
Return the return type of the method this instruction operates on, or null if not set. |
int |
getStackChange()
Return the number of stack positions this instruction pushes or pops during its execution. |
MethodInstruction |
setMethod(BCClass dec,
String name,
BCClass returnType,
BCClass[] params)
Set the method this instruction operates on. |
MethodInstruction |
setMethod(BCMethod method)
Set the method this instruction operates on. |
MethodInstruction |
setMethod(Class dec,
String name,
Class returnType,
Class[] params)
Set the method this instruction operates on. |
MethodInstruction |
setMethod(Constructor method)
Set the method this instruction operates on. |
MethodInstruction |
setMethod(Method method)
Set the method this instruction operates on. |
MethodInstruction |
setMethod(String name,
BCClass returnType,
BCClass[] params)
Set the method this instruction operates on, for methods that are declared by the current class. |
MethodInstruction |
setMethod(String name,
Class returnType,
Class[] params)
Set the method this instruction operates on, for methods that are declared by the current class. |
MethodInstruction |
setMethod(String name,
String returnType,
String[] params)
Set the method this instruction operates on, for methods that are declared by the current class. |
MethodInstruction |
setMethod(String dec,
String name,
String returnType,
String[] params)
Set the method this instruction operates on. |
MethodInstruction |
setMethodDeclarer(BCClass type)
Set the declaring type of the method this instruction operates on. |
MethodInstruction |
setMethodDeclarer(Class type)
Set the declaring type of the method this instruction operates on. |
MethodInstruction |
setMethodDeclarer(String type)
Set the declaring type of the method this instruction operates on. |
MethodInstruction |
setMethodIndex(int index)
Set the index in the class ConstantPool of the
ComplexEntry describing the method to operate on. |
MethodInstruction |
setMethodName(String name)
Set the name of the method this instruction operates on. |
void |
setMethodParams(BCClass[] types)
Set the param types of the method this instruction operates on. |
void |
setMethodParams(Class[] types)
Set the param types of the method this instruction operates on. |
MethodInstruction |
setMethodParams(String[] types)
Set the param types of the method this instruction operates on. |
MethodInstruction |
setMethodReturn(BCClass type)
Set the return type of the method this instruction operates on. |
MethodInstruction |
setMethodReturn(Class type)
Set the return type of the method this instruction operates on. |
MethodInstruction |
setMethodReturn(String type)
Set the return type of the method this instruction operates on. |
Methods inherited from class serp.bytecode.Instruction |
---|
getByteIndex, getClassLoader, getCode, getLineNumber, getName, getOpcode, getPool, getProject, isValid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int getLogicalStackChange()
Instruction
getLogicalStackChange
in class Instruction
public int getStackChange()
Instruction
getStackChange
in class Instruction
public int getMethodIndex()
ConstantPool
of the
ComplexEntry
describing the method to operate on.
public MethodInstruction setMethodIndex(int index)
ConstantPool
of the
ComplexEntry
describing the method to operate on.
public BCMethod getMethod()
public MethodInstruction setMethod(BCMethod method)
public MethodInstruction setMethod(Method method)
public MethodInstruction setMethod(Constructor method)
public MethodInstruction setMethod(String dec, String name, String returnType, String[] params)
dec
- the full class name of the method's declaring classname
- the method namereturnType
- the full class name of the method return typeparam
- the full class names of the method param types
public MethodInstruction setMethod(String name, String returnType, String[] params)
name
- the method namereturnType
- the full class name of the method return typeparam
- the full class names of the method param types
public MethodInstruction setMethod(Class dec, String name, Class returnType, Class[] params)
dec
- the method's declaring classname
- the method namereturnType
- the class of the method return typeparam
- the class of the method param types
public MethodInstruction setMethod(String name, Class returnType, Class[] params)
name
- the method namereturnType
- the class of the method return typeparam
- the class of the method param types
public MethodInstruction setMethod(BCClass dec, String name, BCClass returnType, BCClass[] params)
dec
- the method's declaring classname
- the method namereturnType
- the class of the method return typeparam
- the class of the method param types
public MethodInstruction setMethod(String name, BCClass returnType, BCClass[] params)
name
- the method namereturnType
- the class of the method return typeparam
- the class of the method param types
public String getMethodName()
public MethodInstruction setMethodName(String name)
public String getMethodReturnName()
public Class getMethodReturnType()
public BCClass getMethodReturnBC()
public MethodInstruction setMethodReturn(String type)
public MethodInstruction setMethodReturn(Class type)
public MethodInstruction setMethodReturn(BCClass type)
public String[] getMethodParamNames()
public Class[] getMethodParamTypes()
public BCClass[] getMethodParamBCs()
public MethodInstruction setMethodParams(String[] types)
public void setMethodParams(Class[] types)
public void setMethodParams(BCClass[] types)
public String getMethodDeclarerName()
public Class getMethodDeclarerType()
public BCClass getMethodDeclarerBC()
public MethodInstruction setMethodDeclarer(String type)
public MethodInstruction setMethodDeclarer(Class type)
public MethodInstruction setMethodDeclarer(BCClass type)
public boolean equalsInstruction(Instruction other)
equalsInstruction
in class Instruction
public void acceptVisit(BCVisitor visit)
VisitAcceptor
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 one.
acceptVisit
in interface VisitAcceptor
acceptVisit
in class Instruction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |