|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jreversepro.common.Helper
Helper contains a list of assorted methods that 'helps' in manipulating the data present in the class file.
| Field Summary |
| 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 |
| Method Summary | |
static java.util.List |
getArguments(java.lang.String aSignature)
Returns the arguments in array form given the JVM signature. |
static java.lang.String |
getJavaDataType(java.lang.String aDataType,
boolean associated)
Determines the Java representation , given the JVM representation of data types. |
static java.lang.String |
getPackageName(java.lang.String aFullName)
Returns the Package name alone from a fully qualified name. |
static java.lang.String |
getReturnType(java.lang.String aSignature)
Given the Signature of the method , this provides us the return type. |
static int |
getSignTokenLength(java.lang.String aDataType)
Determines the length of the JVM datatype representation given the JVM signature. |
static java.lang.String |
getValue(java.lang.String value,
java.lang.String datatype)
Both boolean and char are represented as integers . |
static boolean |
isBasicType(java.lang.String type)
Checks if the given datatype is a basic data type or not. |
static boolean |
isDebug()
|
static void |
log(java.lang.Exception ex)
|
static void |
log(java.lang.String logMsg)
|
static void |
logNoEol(java.lang.String logMsg)
Log without end-of-line at the end. |
static java.lang.String |
lowNbits(java.lang.String aValue,
int aNumBits)
Extracts the value of a particular number of bits. |
static java.lang.String |
replaceEscapeChars(java.lang.String aLiteral)
Inserts a '\' before all the escape characters , line '\n' , '\t' to provide better readability. |
static int |
signedToUnsigned(int aByteVal)
Converts a signed 'byte' to an unsigned integer. |
static boolean |
toggleDebug()
Toggles the debug flag. |
static boolean |
versionCheck()
Checks for the version compatibility between the system JRE and the JRE for which the application is written for. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void log(java.lang.String logMsg)
logMsg - Message to be logged.public static void log(java.lang.Exception ex)
ex - Exception to be logged.public static void logNoEol(java.lang.String logMsg)
logMsg - Message to be logged.public static boolean toggleDebug()
public static boolean isDebug()
public static java.lang.String getPackageName(java.lang.String aFullName)
For Example , if FullName = java/lang/StringBuffer,
then a call to getPackageName(arg) returns the
value java.lang.
aFullName - A Fully Qualified Name.
public static java.lang.String getJavaDataType(java.lang.String aDataType,
boolean associated)
dataType |
formatDataType(dataType) |
|---|---|
B | byte |
C | char |
D | double |
F | float |
I | int |
J | long |
S | short |
V | void |
Z | boolean |
[Z | boolean [] , array representation |
Ljava/lang/String |
java/lang/String |
aDataType - JVM representation of the data type.associated - If set, then an array representation is returned.�
public static int getSignTokenLength(java.lang.String aDataType)
dataType |
getSignTokenLength(dataType)(dataType) |
|---|---|
all basic data types | 1 |
[XYZ | len(XYZ) + 1 |
Ljava/lang/String |
len(Ljava/lang/String) |
aDataType - Signature of a method as present in
the class file in JVM representation, containing a list
of datatypes.
public static java.util.List getArguments(java.lang.String aSignature)
For example , IILjava/lang/String
could be returned as
( int , int , java/lang/String ).
aSignature - Signature of the method.
public static java.lang.String getReturnType(java.lang.String aSignature)
aSignature - Signature of the method.
public static java.lang.String lowNbits(java.lang.String aValue,
int aNumBits)
For example lowNBits(169 , 5 )
returns (10101001,5) -> 10101 i.e 21
.
aValue - Value containing the integer in string form.aNumBits - Number of bits that is to be extracted.
public static java.lang.String replaceEscapeChars(java.lang.String aLiteral)
aLiteral - String containing the escape characters.
public static boolean versionCheck()
public static boolean isBasicType(java.lang.String type)
type - the datatype to be checked.
public static java.lang.String getValue(java.lang.String value,
java.lang.String datatype)
value - Old Value.datatype - Datatype of the value.
public static int signedToUnsigned(int aByteVal)
aByteVal - a Byte Value.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||