All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class shai.vmutils.VMAnalizer

java.lang.Object
   |
   +----shai.vmutils.VMAnalizer

public class VMAnalizer
extends Object
implements Constants
the VMAnalizer class analizes the structure of a class file. the Constants interface contains all the predefined constants for class file parsing. This class was developed by studying java's source code. it does not contain any copyrighted material of Sun but it might bare some external simlarities to Sun's classes. Sun provides an excelent class for loding class files called BinaryClass however that class was not designed for the same purposes as this class, however you may find it very useful.


Variable Index

 o attributeTable
 o className
 o constantPool
 o listOfFields
 o listOfMethods
 o majorVersion
 o minorVersion
 o modifiers
 o superClassName
 o supportedInterfaces

Constructor Index

 o VMAnalizer(String)
the constructor takes a classFileName which loads the binaryClassRepresentation and enables the interogation of the classes properties.

Method Index

 o getClassAttributes()
This method returns the attributes of the class.
 o getClassName()
This method returns the name of this class.
 o getConstantPoolCount()
This method returns the number of iterms in the constant pool.
 o getEntry(int)
This method returns the entry at offset.
 o getEntryOffsetType(int)
This method returns the type of the entry at offset.
 o getField(int)
This method returns the field entry at offset.
 o getFieldCount()
This method returns the number of the fields in the class.
 o getInterfaceAsString(int)
This method returns the name of the interface on offset interfaceNumber or null if the number of interfaces is exceeded.
 o getMajorVersion()
This method was created by a SmartGuide.
 o getMethod(int)
This method returns the method entry at offset.
 o getMethodCount()
This method returns the number of the methods in the class.
 o getMinorVersion()
This method was created by a SmartGuide.
 o getModifiersAsString()
This method returns the classes modifiers as a string.
 o getSuperClassName()
This method returns the name of the super class.
 o loadClass(String)
This method loads a class file into memory and analizes it.
 o main(String[])
this method was created for testing the VMAnalizer.
 o saveClass(String)
This method was created by a SmartGuide.

Variables

 o minorVersion
 private int minorVersion
 o majorVersion
 private int majorVersion
 o constantPool
 private ConstantPoolEntry constantPool[]
 o modifiers
 private int modifiers
 o className
 private int className
 o superClassName
 private int superClassName
 o supportedInterfaces
 private int supportedInterfaces[]
 o listOfFields
 private FieldEntry listOfFields[]
 o listOfMethods
 private MethodEntry listOfMethods[]
 o attributeTable
 private AttributeEntry attributeTable

Constructors

 o VMAnalizer
 public VMAnalizer(String classFileName) throws IOException
the constructor takes a classFileName which loads the binaryClassRepresentation and enables the interogation of the classes properties.

Methods

 o getClassAttributes
 public AttributeEntry getClassAttributes()
This method returns the attributes of the class.

Returns:
shai.vmutils.AttributeEntry
 o getClassName
 public String getClassName()
This method returns the name of this class.

Returns:
java.lang.String
 o getConstantPoolCount
 public int getConstantPoolCount()
This method returns the number of iterms in the constant pool.

Returns:
int
 o getEntry
 public Object getEntry(int offset)
This method returns the entry at offset.

Parameters:
offset - int
Returns:
java.lang.Object
 o getEntryOffsetType
 public byte getEntryOffsetType(int offset)
This method returns the type of the entry at offset.

Returns:
int
 o getField
 public FieldEntry getField(int offset)
This method returns the field entry at offset.

 o getFieldCount
 public int getFieldCount()
This method returns the number of the fields in the class.

Returns:
int
 o getInterfaceAsString
 public String getInterfaceAsString(int interfaceNumber)
This method returns the name of the interface on offset interfaceNumber or null if the number of interfaces is exceeded.

Parameters:
interfaceNumber - int
Returns:
java.lang.String
 o getMajorVersion
 public int getMajorVersion()
This method was created by a SmartGuide.

Returns:
int
 o getMethod
 public MethodEntry getMethod(int offset)
This method returns the method entry at offset.

 o getMethodCount
 public int getMethodCount()
This method returns the number of the methods in the class.

Returns:
int
 o getMinorVersion
 public int getMinorVersion()
This method was created by a SmartGuide.

Returns:
int
 o getModifiersAsString
 public String getModifiersAsString()
This method returns the classes modifiers as a string.

Returns:
java.lang.String
 o getSuperClassName
 public String getSuperClassName()
This method returns the name of the super class.

Returns:
java.lang.String
 o loadClass
 public void loadClass(String classFileName) throws IOException
This method loads a class file into memory and analizes it.

Parameters:
classFileName - java.lang.String
Throws: IOException
The exception description.
 o main
 public static void main(String argv[])
this method was created for testing the VMAnalizer.

 o saveClass
 public void saveClass(String classFileName) throws IOException
This method was created by a SmartGuide.

Parameters:
classFileName - java.lang.String
Throws: IOException
The exception description.

All Packages  Class Hierarchy  This Package  Previous  Next  Index