|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--jreversepro.reflect.JMember
|
+--jreversepro.reflect.JMethod
JMethod is the abstract representation of a method in the class method..
| Field Summary |
| Fields inherited from class jreversepro.reflect.JMember |
ACC_ABSTRACT, ACC_FINAL, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, datatype, name, qualifier |
| Fields inherited from interface jreversepro.common.KeyWords |
ANY, BOOLEAN, BREAK, BYTE, CASE, CHAR, CLASS, CLASS_STRING, CLINIT, CLOSE_BRACKET, COND_AND, COND_NOT, COND_OR, CONTINUE, DEFAULT, DEFAULT_PACKAGE, DOUBLE, EQUALTO, FALSE, FLOAT, FOREIGN_CLASS, FOREIGN_OBJ, GOTO, INIT, INSTANCEOF, INT, INTERFACE, JVM_BOOLEAN, JVM_CHAR, JVM_VOID, LANG_OBJECT, LENGTH, LONG, NEW, NULL, OPEN_BRACKET, OPR_EQ, OPR_GE, OPR_GT, OPR_LE, OPR_LT, OPR_NE, OPR_NOT, REFERENCE, RET_ADDR, RETURN, SHORT, SPACE, STATIC, SUPER, SWITCH, THIS, THISCLASS, THROW, TRUE, VOID |
| Constructor Summary | |
JMethod(JClassInfo info)
|
|
| Method Summary | |
void |
addBlock(JBlockObject jbo)
Add a new JBlockObject to the stack - indicates that a block is opening |
void |
addExceptionBlock(int startPc,
int endPc,
int handlerPc,
java.lang.String datatype)
Add an exception block. |
void |
addLineOfCode(JLineOfCode loc)
Adds a line of code to the current block |
void |
closeBlock()
Close the current JBlockObject -- pop it from the stack Called when an end of block is reached. |
protected int |
dealLookupSwitch(int index)
This method returns the length of the variable instruction lookupswitch. |
protected int |
dealTableSwitch(int index)
This method returns the length of the variable instruction tableswitch. |
java.util.Map |
getAllCatchJExceptions()
Returns a map |
protected byte[] |
getArgArray(int start,
int end)
Given the start index and the end index this method returns a byte array that contain the byte values with the start array value included and end array excluded. |
java.util.List |
getArgList()
Returns the argument list. |
JMethodBlock |
getBlock()
|
protected byte[] |
getBytes()
Returns the bytecode array of the method |
java.util.List |
getexceptionBlocks()
Returns the exception table. |
JInstruction |
getFirstIns()
Get First Instruction. |
JInstruction |
getInstruction(int ind)
Returns the JInstruction having the specified byte offset |
java.util.List |
getInstructions()
Returns the list of bytecodes in the method. |
JLineNumberTable |
getLineTable()
Returns the LineNumberTable of the method. |
java.lang.String |
getLocalStackInfo()
Returns the initial code / information about the method. |
int |
getMaxLocals()
Returns the maximum local members of this method. |
int |
getMaxStack()
Returns the max. |
java.lang.String |
getMethodAsString(boolean getBytecode,
boolean includeStackInfo)
|
java.lang.String |
getMethodHeader(boolean includeStackInfo)
Returns the headers for the method. |
JInstruction |
getNextInstruction(int ind)
Returns the JInstruction following the instruction having the specified byte offset |
java.lang.String |
getReturnType()
Returns the return type of the method. |
java.lang.String |
getSignature()
Returns the signature of the method. |
java.lang.String |
getStringifiedBytecode()
|
java.util.List |
getThrowsClasses()
Returns the .list of classes thrown by this method. |
java.lang.String |
getThrowsClause(JImport importInfo)
returns a throws clause for the method |
boolean |
isStatic()
Returns ifthis method is static. |
void |
normalize()
Normalization of the bytecodes into JVM codes. |
JBlockObject |
removeCurrentBlock()
Removes and returns the last block added |
JLineOfCode |
removeLastLineOfCode()
Removes and returns the last line of code added from the current block |
void |
setBytes(byte[] bytecodes)
Sets the bytecode array. |
void |
setLineTable(JLineNumberTable rhsLineTable)
Sets the line number table. |
void |
setMaxLocals(int maxLocals)
Sets the max. |
void |
setMaxStack(int maxStack)
Sets the max. |
void |
setSignature(java.lang.String rhsSign)
Setter method for Signature |
void |
setStringifiedBytecode(java.lang.String str)
Sets the bytecode for this method; |
void |
setSymbolTable(JSymbolTable st)
|
void |
setThrowsClasses(java.util.List throwsClasses)
Sets the .list of classes thrown by this method. |
| Methods inherited from class jreversepro.reflect.JMember |
getDatatype, getName, getQualifier, getQualifierName, getStringRep, isFinal, setDatatype, setName, setQualifier |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JMethod(JClassInfo info)
info - The JSymbolTable associated with this class
Creates a new JMethod| Method Detail |
public JMethodBlock getBlock()
public void addBlock(JBlockObject jbo)
jbo - JBlockObject to be added.public void closeBlock()
public void addLineOfCode(JLineOfCode loc)
loc - Line Of Code to be added.public JLineOfCode removeLastLineOfCode()
public JBlockObject removeCurrentBlock()
public void setSymbolTable(JSymbolTable st)
st - The JSymbolTable associated with this class
Set the Symbol tablepublic void setSignature(java.lang.String rhsSign)
rhsSign - Signature field value.
public void addExceptionBlock(int startPc,
int endPc,
int handlerPc,
java.lang.String datatype)
startPc - Start of the try blockendPc - End of try blockhandlerPc - Beginning of handler blockdatatype - Type of the class that the
handler is going to handle.public void setLineTable(JLineNumberTable rhsLineTable)
rhsLineTable - Line number Table that is created
by the compiler if the debugging option is on.public java.lang.String getReturnType()
public java.lang.String getSignature()
public java.util.List getArgList()
public java.util.List getThrowsClasses()
public int getMaxLocals()
public int getMaxStack()
public void setThrowsClasses(java.util.List throwsClasses)
throwsClasses - Classes Thrownpublic void setMaxLocals(int maxLocals)
maxLocals - Max Localspublic void setMaxStack(int maxStack)
maxStack - Max. Stack lengthprotected byte[] getBytes()
public void setBytes(byte[] bytecodes)
bytecodes - the bytecode array input.public java.util.List getexceptionBlocks()
public java.util.Map getAllCatchJExceptions()
public java.util.List getInstructions()
public JInstruction getInstruction(int ind)
ind - Index of the instruction.
public JInstruction getNextInstruction(int ind)
ind - Index of the instruction.
public JLineNumberTable getLineTable()
public java.lang.String getLocalStackInfo()
public boolean isStatic()
isStatic in class JMemberpublic void normalize()
public JInstruction getFirstIns()
protected int dealTableSwitch(int index)
index - beginning index of the tableswitch statement
into the bytecode stream of the method.
The format is as follows.
The first 4 bytes are for defaultbyte.
The next 4 for the lowest value in the case leg values.
The next 4 for the highest value in the case high values.
Then we will have ( high - low ) * 4 bytes - all
containing the target index to be junmped into
relative to the index of the current switch instruction.
protected int dealLookupSwitch(int index)
index - beginning index of the lookupswitch statement
into the bytecode stream of the method.
The format is as follows.
The first 4 bytes are for defaultbyte.
The next 4 for the number of pairs of ( case leg value, target)
that will appear as follows, say N.
Then there will be (2 * N) * 4 bytes , ( N pairs of integers ),
with each pair containing the case leg value first and the
second integer letting us know the target of the case leg
relative to the index of the method.
protected byte[] getArgArray(int start,
int end)
start - start index into the byte array.end - end index into the byte array.
public java.lang.String getThrowsClause(JImport importInfo)
importInfo - containing the import information.
public java.lang.String getMethodHeader(boolean includeStackInfo)
includeStackInfo - Denotes if the stack information
like maximum local variables, stack information are supposed
to be included in the reverse engineered code.
Moved from JDecompiler by pazandak@objs.com
public java.lang.String getMethodAsString(boolean getBytecode,
boolean includeStackInfo)
getBytecode - TRUE if bytecode is to be returned, FALSE if
decompiled code should be returned.includeStackInfo - TRUE if stack & exception info should be
output
public java.lang.String getStringifiedBytecode()
public void setStringifiedBytecode(java.lang.String str)
str - Bytecode disassembled string representation.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||