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.
-
attributeTable
-
-
className
-
-
constantPool
-
-
listOfFields
-
-
listOfMethods
-
-
majorVersion
-
-
minorVersion
-
-
modifiers
-
-
superClassName
-
-
supportedInterfaces
-
-
VMAnalizer(String)
- the constructor takes a classFileName which loads the binaryClassRepresentation
and enables the interogation of the classes properties.
-
getClassAttributes()
- This method returns the attributes of the class.
-
getClassName()
- This method returns the name of this class.
-
getConstantPoolCount()
- This method returns the number of iterms in the constant pool.
-
getEntry(int)
- This method returns the entry at offset.
-
getEntryOffsetType(int)
- This method returns the type of the entry at offset.
-
getField(int)
- This method returns the field entry at offset.
-
getFieldCount()
- This method returns the number of the fields in the class.
-
getInterfaceAsString(int)
- This method returns the name of the interface on offset interfaceNumber or null if
the number of interfaces is exceeded.
-
getMajorVersion()
- This method was created by a SmartGuide.
-
getMethod(int)
- This method returns the method entry at offset.
-
getMethodCount()
- This method returns the number of the methods in the class.
-
getMinorVersion()
- This method was created by a SmartGuide.
-
getModifiersAsString()
- This method returns the classes modifiers as a string.
-
getSuperClassName()
- This method returns the name of the super class.
-
loadClass(String)
- This method loads a class file into memory and analizes it.
-
main(String[])
- this method was created for testing the VMAnalizer.
-
saveClass(String)
- This method was created by a SmartGuide.
minorVersion
private int minorVersion
majorVersion
private int majorVersion
constantPool
private ConstantPoolEntry constantPool[]
modifiers
private int modifiers
className
private int className
superClassName
private int superClassName
supportedInterfaces
private int supportedInterfaces[]
listOfFields
private FieldEntry listOfFields[]
listOfMethods
private MethodEntry listOfMethods[]
attributeTable
private AttributeEntry attributeTable
VMAnalizer
public VMAnalizer(String classFileName) throws IOException
- the constructor takes a classFileName which loads the binaryClassRepresentation
and enables the interogation of the classes properties.
getClassAttributes
public AttributeEntry getClassAttributes()
- This method returns the attributes of the class.
- Returns:
- shai.vmutils.AttributeEntry
getClassName
public String getClassName()
- This method returns the name of this class.
- Returns:
- java.lang.String
getConstantPoolCount
public int getConstantPoolCount()
- This method returns the number of iterms in the constant pool.
- Returns:
- int
getEntry
public Object getEntry(int offset)
- This method returns the entry at offset.
- Parameters:
- offset - int
- Returns:
- java.lang.Object
getEntryOffsetType
public byte getEntryOffsetType(int offset)
- This method returns the type of the entry at offset.
- Returns:
- int
getField
public FieldEntry getField(int offset)
- This method returns the field entry at offset.
getFieldCount
public int getFieldCount()
- This method returns the number of the fields in the class.
- Returns:
- int
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
getMajorVersion
public int getMajorVersion()
- This method was created by a SmartGuide.
- Returns:
- int
getMethod
public MethodEntry getMethod(int offset)
- This method returns the method entry at offset.
getMethodCount
public int getMethodCount()
- This method returns the number of the methods in the class.
- Returns:
- int
getMinorVersion
public int getMinorVersion()
- This method was created by a SmartGuide.
- Returns:
- int
getModifiersAsString
public String getModifiersAsString()
- This method returns the classes modifiers as a string.
- Returns:
- java.lang.String
getSuperClassName
public String getSuperClassName()
- This method returns the name of the super class.
- Returns:
- java.lang.String
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.
main
public static void main(String argv[])
- this method was created for testing the VMAnalizer.
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