All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class DE.fub.inf.JVM.JavaClass.JavaClass

java.lang.Object
   |
   +----DE.fub.inf.JVM.JavaClass.JavaClass

public class JavaClass
extends Object
implements Constants
Represents a Java class, i.e. the data structures, constant pool, fields, methods and commands contained in a Java .class file. See JVM specification for details.

Version:
970922
Author:
M. Dahm

Constructor Index

 o JavaClass(short, short, String, short, short, short, ConstantPool, short[], Field[], Method[], Attribute[])
Constructor gets all contents as arguments.

Method Index

 o accept(Visitor)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
 o dump(File)
Dump class to a file, this should create a valid .class file.
 o dump(String)
Dump class to a file, this should create a valid .class file.
 o getAccessFlags()
 o getAttributes()
 o getClassName()
 o getClassNameIndex()
 o getConstantPool()
 o getFields()
 o getFileName()
 o getInterfaceNames()
 o getInterfaces()
 o getMajor()
 o getMethods()
 o getMinor()
 o getSourceFileName()
 o getSuperclassName()
 o getSuperclassNameIndex()
 o initJavaClass()
Initialize the package.
 o setAccessFlags(short)
 o setAttributes(Attribute[])
 o setClassName(String)
 o setClassNameIndex(short)
 o setConstantPool(ConstantPool)
 o setFields(Field[])
 o setFileName(String)
 o setInterfaceNames(String[])
 o setInterfaces(short[])
 o setMajor(short)
 o setMethods(Method[])
 o setMinor(short)
 o setSourceFileName(String)
 o setSuperclassName(String)
 o setSuperclassNameIndex(short)
 o toString()

Constructors

 o JavaClass
 public JavaClass(short class_name_index,
                  short superclass_name_index,
                  String file_name,
                  short major,
                  short minor,
                  short access_flags,
                  ConstantPool constant_pool,
                  short interfaces[],
                  Field fields[],
                  Method methods[],
                  Attribute attributes[])
Constructor gets all contents as arguments.

Parameters:
class_name - Class name
superclass_name - Superclass name
file_name - File name
major - Major compiler version
minor - Minor compiler version
access_flags - Access rights defined by bit flags
constant_pool - Array of constants
interfaces - Implemented interfaces
fields - Class fields
methods - Class methods
attributes - Class attributes

Methods

 o accept
 public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v - Visitor object
 o dump
 public void dump(File file) throws IOException
Dump class to a file, this should create a valid .class file.

Parameters:
file - Output file
 o dump
 public void dump(String file_name) throws IOException
Dump class to a file, this should create a valid .class file.

Parameters:
file_name - Output file name
 o getAccessFlags
 public final short getAccessFlags()
Returns:
Access rights of class.
 o getAttributes
 public final Attribute[] getAttributes()
Returns:
Attributes of the class.
 o getClassName
 public final String getClassName()
Returns:
Class name.
 o getClassNameIndex
 public final short getClassNameIndex()
Returns:
Class name index.
 o getConstantPool
 public final ConstantPool getConstantPool()
Returns:
Constant pool.
 o getFields
 public final Field[] getFields()
Returns:
Fields, i.e. variables of the class.
 o getFileName
 public final String getFileName()
Returns:
File name.
 o getInterfaceNames
 public final String[] getInterfaceNames()
Returns:
Names of implemented interfaces.
 o getInterfaces
 public final short[] getInterfaces()
Returns:
Implemented interfaces.
 o getMajor
 public final short getMajor()
Returns:
Major number of compiler version.
 o getMethods
 public final Method[] getMethods()
Returns:
Methods of the class.
 o getMinor
 public final short getMinor()
Returns:
Minor number of compiler version.
 o getSourceFileName
 public final String getSourceFileName()
Returns:
File name of source.
 o getSuperclassName
 public final String getSuperclassName()
Returns:
Superclass name.
 o getSuperclassNameIndex
 public final short getSuperclassNameIndex()
Returns:
Class name index.
 o initJavaClass
 public static void initJavaClass()
Initialize the package.

 o setAccessFlags
 public final void setAccessFlags(short access_flags)
 o setAttributes
 public final void setAttributes(Attribute attributes[])
 o setClassName
 public final void setClassName(String class_name)
 o setClassNameIndex
 public final void setClassNameIndex(short class_name_index)
 o setConstantPool
 public final void setConstantPool(ConstantPool constant_pool)
 o setFields
 public final void setFields(Field fields[])
 o setFileName
 public final void setFileName(String file_name)
 o setInterfaceNames
 public final void setInterfaceNames(String interface_names[])
 o setInterfaces
 public final void setInterfaces(short interfaces[])
 o setMajor
 public final void setMajor(short major)
 o setMethods
 public final void setMethods(Method methods[])
 o setMinor
 public final void setMinor(short minor)
 o setSourceFileName
 public final void setSourceFileName(String source_file_name)
 o setSuperclassName
 public final void setSuperclassName(String superclass_name)
 o setSuperclassNameIndex
 public final void setSuperclassNameIndex(short superclass_name_index)
 o toString
 public String toString()
Returns:
String representing class contents.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index