|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jreversepro.reflect.JClassInfo
JClassInfo is the abstract representation of the Class File. The names of the methods are self explanatory.
| Field Summary | |
static int |
ACC_INTERFACE
ACC_INTERFACE bit required to be set if it is an interface and not a class. |
static int |
ACC_SUPER
ACC_SUPER bit required to be set on all modern classes. |
| 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 | |
JClassInfo()
Empty constructor |
|
| Method Summary | |
void |
addField(JField rhsField)
Adds a new field present in the class. |
void |
addInterface(java.lang.String interfaceName)
Adds a new interface that is implemented by this class. |
void |
addMethod(JMethod rhsMethod)
Adds a new method present in the class. |
java.lang.String |
getAccessString()
Returns the access string of this class. |
JConstantPool |
getConstantPool()
Returns the constantpool reference |
java.util.List |
getFields()
Returns the fields present in the class. |
java.util.List |
getInterfaces()
Returns the List of interfaces of the current class. |
int |
getMajor()
Returns the major number of the JVM. |
java.util.List |
getMethods()
Returns the methods of this class. |
int |
getMinor()
Returns the minor number of the JVM. |
java.lang.String |
getPathName()
Returns the path name of this class. |
java.lang.String |
getSourceFile()
Returns the source file of the current class. |
java.lang.String |
getStringifiedClass(boolean getBytecode)
Returns the stringified disassembled/decompiled class. |
java.lang.String |
getStringifiedClass(boolean getBytecode,
boolean includeMetadata)
Returns the stringified disassembled/decompiled class, optionally with metadata. |
java.lang.String |
getStringifiedMethods(boolean getBytecode,
boolean includeMetadata)
Returns the stringified disassembled/decompiled method. |
java.lang.String |
getSuperClass()
Returns the class name of this class' super class. |
java.lang.String |
getThisClass()
Returns the class name of this class. |
java.lang.String |
getThisClass(boolean fullyQualified)
|
boolean |
isClass()
Returns if this is a class or an interface |
void |
processMethods(boolean getBytecode)
Process the methods. |
void |
reverseEngineer(boolean getBytecode)
Reverse Engineer the Class file. |
void |
setAccess(int rhsAccess)
Sets the access flag of the class. |
void |
setConstantPool(JConstantPool cpInfo)
Sets the ConstantPool information of this class. |
void |
setMajorMinor(short rhsMajor,
short rhsMinor)
Sets the major and minor number of the JVM for which this class file is compiled for. |
void |
setPackageName(java.lang.String packageName)
Sets the package to which this class belongs to. |
void |
setPathName(java.lang.String classPath)
Sets the pathname of this class. |
void |
setSourceFile(java.lang.String rhsSrcFile)
Sets the name of the source file to which this was contained in. |
void |
setSuperClass(java.lang.String rhsName)
Sets the name of the current class' superclass. |
void |
setThisClass(java.lang.String rhsName)
Sets the name of the current class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ACC_SUPER
public static final int ACC_INTERFACE
| Constructor Detail |
public JClassInfo()
| Method Detail |
public void addInterface(java.lang.String interfaceName)
interfaceName - Name of the interface.public void addField(JField rhsField)
rhsField - contains the field-related information.public void addMethod(JMethod rhsMethod)
rhsMethod - contains the method-related information.public void setPathName(java.lang.String classPath)
classPath - Path to this class.public void setConstantPool(JConstantPool cpInfo)
cpInfo - contains the constant pool information
of this class.public JConstantPool getConstantPool()
public void setMajorMinor(short rhsMajor,
short rhsMinor)
rhsMajor - Major numberrhsMinor - Minor numberpublic void setAccess(int rhsAccess)
rhsAccess - Access flag of the class.public void setThisClass(java.lang.String rhsName)
rhsName - Name of this class.public void setSuperClass(java.lang.String rhsName)
rhsName - Name of this class; superclass.public void setPackageName(java.lang.String packageName)
packageName - name of the package to be set.public void setSourceFile(java.lang.String rhsSrcFile)
rhsSrcFile - Name of the source file.public java.lang.String getPathName()
public int getMajor()
public int getMinor()
public java.lang.String getThisClass(boolean fullyQualified)
fullyQualified - Parameter to indicate if to return
the fully qualified name.
Yes - Fully qualified name along with the package name.
No - Just the class name only.
public java.lang.String getThisClass()
public java.lang.String getSuperClass()
public java.lang.String getSourceFile()
public java.util.List getInterfaces()
public java.util.List getFields()
public java.util.List getMethods()
public java.lang.String getAccessString()
public boolean isClass()
public void processMethods(boolean getBytecode)
getBytecode - TRUE - disassemble.
FALSE - disassemble.public java.lang.String getStringifiedClass(boolean getBytecode)
getBytecode - If TRUE, returns the disassembled code
IF the class has already been disassembled. If FALSE,
returns the decompiled code IF the class has been
decompiled. Otherwise, returns null;
public java.lang.String getStringifiedClass(boolean getBytecode,
boolean includeMetadata)
getBytecode - If TRUE, returns the disassembled code
IF the class has already been disassembled. If FALSE,
returns the decompiled code IF the class has been
decompiled. Otherwise, returns null;includeMetadata - - TRUE if method stack & exception data should be
output.
public java.lang.String getStringifiedMethods(boolean getBytecode,
boolean includeMetadata)
getBytecode - If TRUE, returns the disassembled code
IF the method has already been disassembled. If FALSE,
returns the decompiled code IF the method has been
decompiled. Otherwise, returns null;includeMetadata - - TRUE if method stack & exception data should be
output
public void reverseEngineer(boolean getBytecode)
throws ClassParserException,
RevEngineException
getBytecode - True disassembler, false - decompile.
ClassParserException - Thrown if class file not in proper format.
RevEngineException - Thrown if error occured in reverse
engineering file.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||