Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jreversepro.common
Class Helper  view Helper download Helper.java

java.lang.Object
  extended byjreversepro.common.Helper
All Implemented Interfaces:
KeyWords

public class Helper
extends java.lang.Object
implements KeyWords

Helper contains a list of assorted methods that 'helps' in manipulating the data present in the class file.


Field Summary
(package private) static boolean debugFlag
          Debug flag Default value = false.
(package private) static java.lang.String DEFAULT_VERSION
          Working Version Could be compromised
 
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
private Helper()
          Private constructor to prevent any instance from being created.
 
Method Summary
static java.util.List getArguments(java.lang.String aSignature)
          Returns the arguments in array form given the JVM signature.
private static java.lang.String getAtomicValue(java.lang.String value, java.lang.String datatype)
          Both boolean and char are represented as integers .
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.
private static java.lang.String representChar(char aChar)
          Returns the String representation of the character .
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
 

Field Detail

DEFAULT_VERSION

static final java.lang.String DEFAULT_VERSION
Working Version Could be compromised

See Also:
Constant Field Values

debugFlag

static boolean debugFlag
Debug flag Default value = false.

Constructor Detail

Helper

private Helper()
Private constructor to prevent any instance from being created.

Method Detail

log

public static void log(java.lang.String logMsg)

log

public static void log(java.lang.Exception ex)

logNoEol

public static void logNoEol(java.lang.String logMsg)
Log without end-of-line at the end.


toggleDebug

public static boolean toggleDebug()
Toggles the debug flag.


isDebug

public static boolean isDebug()

getPackageName

public static java.lang.String getPackageName(java.lang.String aFullName)
Returns the Package name alone from a fully qualified name.

For Example , if FullName = java/lang/StringBuffer,
then a call to getPackageName(arg) returns the value java.lang.


getJavaDataType

public static java.lang.String getJavaDataType(java.lang.String aDataType,
                                               boolean associated)
Determines the Java representation , given the JVM representation of data types.

dataType formatDataType(dataType)
Bbyte
Cchar
Ddouble
Ffloat
Iint
Jlong
Sshort
Vvoid
Zboolean
[Zboolean [] , array representation
Ljava/lang/String java/lang/String


getSignTokenLength

public static int getSignTokenLength(java.lang.String aDataType)
Determines the length of the JVM datatype representation given the JVM signature.

dataType getSignTokenLength(dataType)(dataType)
all basic data types1
[XYZlen(XYZ) + 1
Ljava/lang/String len(Ljava/lang/String)


getArguments

public static java.util.List getArguments(java.lang.String aSignature)
Returns the arguments in array form given the JVM signature.

For example , IILjava/lang/String could be returned as
( int , int , java/lang/String ).


getReturnType

public static java.lang.String getReturnType(java.lang.String aSignature)
Given the Signature of the method , this provides us the return type.


lowNbits

public static java.lang.String lowNbits(java.lang.String aValue,
                                        int aNumBits)
Extracts the value of a particular number of bits.

For example lowNBits(169 , 5 ) returns (10101001,5) -> 10101 i.e 21
.


replaceEscapeChars

public static java.lang.String replaceEscapeChars(java.lang.String aLiteral)
Inserts a '\' before all the escape characters , line '\n' , '\t' to provide better readability.


representChar

private static java.lang.String representChar(char aChar)
Returns the String representation of the character .


versionCheck

public static boolean versionCheck()
Checks for the version compatibility between the system JRE and the JRE for which the application is written for.


isBasicType

public static boolean isBasicType(java.lang.String type)
Checks if the given datatype is a basic data type or not.


getValue

public static java.lang.String getValue(java.lang.String value,
                                        java.lang.String datatype)
Both boolean and char are represented as integers . This takes care of the conversions


getAtomicValue

private static java.lang.String getAtomicValue(java.lang.String value,
                                               java.lang.String datatype)
Both boolean and char are represented as integers . This takes care of the conversions


signedToUnsigned

public static int signedToUnsigned(int aByteVal)
Converts a signed 'byte' to an unsigned integer.