All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class BIT.highBIT.ClassInfo

java.lang.Object
   |
   +----BIT.highBIT.ClassInfo

public class ClassInfo
extends Object
Contains information about a Java .class file.

See Also:
ClassFile, Routine

Variable Index

 o class_name
Name of this class.
 o classfile
Contains parsed class structure.
 o routines
Vector of methods defined in this class file.
 o source_file_name
Name of the source file.
 o superclass_name
Name of super class.

Constructor Index

 o ClassInfo(String)
Creates a new ClassInfo class which breaks down a .class into more easily manageble entities such as Routines.

Method Index

 o addAfter(String, String, Object)
Allows one to add a method after this class.
 o addBefore(String, String, Object)
Allows one to add a method before this class.
 o addConstantPoolEntry(Cp_Info)
Adds an entry to the constant pool.
 o getClassName()
Returns the name of this class.
 o getConstantPool()
 o getRoutineCount()
Returns the number of routiens in this class.
 o getRoutines()
Returns the routines in this class.
 o getSourceFileName()
Returns the name of the source file.
 o getSuperClassName()
Returns the name of the super class.
 o isExit(int)
 o write(String)
Outputs the class file structure to a file.

Variables

 o classfile
 protected ClassFile classfile
Contains parsed class structure.

See Also:
ClassFile
 o class_name
 protected String class_name
Name of this class.
This value can be read by invoking getClassName method.

See Also:
getClassName
 o superclass_name
 protected String superclass_name
Name of super class.
This value can be read by invoking getSuperClassName method.

See Also:
getSuperClassName
 o source_file_name
 protected String source_file_name
Name of the source file.
This value can be read by invoking getSourceFileName method.

See Also:
getSourceFileName
 o routines
 protected Vector routines
Vector of methods defined in this class file.
This value is set when the constructor is invoked and can be read by invoking getRoutines method.

See Also:
getRoutines, Vector

Constructors

 o ClassInfo
 public ClassInfo(String filename)
Creates a new ClassInfo class which breaks down a .class into more easily manageble entities such as Routines.
The only attribute that it looks at is the "SourceFile" attribute.

Parameters:
filename - the filename of the .class file to be analyzed
See Also:
ClassFile, CONSTANT_Utf8_Info, CONSTANT_Class_Info, Routine, Vector

Methods

 o getClassName
 public String getClassName()
Returns the name of this class.

 o getSuperClassName
 public String getSuperClassName()
Returns the name of the super class.

 o getSourceFileName
 public String getSourceFileName()
Returns the name of the source file.

 o getRoutines
 public Vector getRoutines()
Returns the routines in this class.

See Also:
Vector
 o getRoutineCount
 public int getRoutineCount()
Returns the number of routiens in this class.

 o getConstantPool
 public Cp_Info[] getConstantPool()
 o addConstantPoolEntry
 public Cp_Info[] addConstantPoolEntry(Cp_Info entry)
Adds an entry to the constant pool.

Parameters:
the - constant pool entry to be addded
Returns:
the new array where the new entry has been added
See Also:
Cp_Info
 o write
 public void write(String filename)
Outputs the class file structure to a file.

Parameters:
the - name of the output file
 o addBefore
 public void addBefore(String classname,
                       String methodname,
                       Object arg)
Allows one to add a method before this class.

Parameters:
String - representing the name of the class of the method to be added
String - the name of the method itself
Object - to be passed to the method as argument
 o addAfter
 public void addAfter(String classname,
                      String methodname,
                      Object arg)
Allows one to add a method after this class. Important! Because a Java program typically consists of different class files, the meaning of adding a call to a method after a class is not clear. Here we define adding a method after a class to mean that a call to a method will be inserted before end of this class only if this class contains the main method. In particular, one should note that if a program exits through a call to System.exit(), Runtime.exit(), or through other abnormal ways, it cannot be guaranteed that the call inserted will get executed at all before program termination. One workaround is to instrument System.exit() and Runtime.exe() in your own standard Java class library. Please email us if you know a good way to fix this semantic problem.

Parameters:
String - representing the name of the class of the method to be added
String - the name of the method itself
Object - to be passed to the method as argument
 o isExit
 public boolean isExit(int index)

All Packages  Class Hierarchy  This Package  Previous  Next  Index