All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class espresso.classfile.classgen.ClassGen

java.lang.Object
   |
   +----espresso.classfile.classgen.ClassGen

public final class ClassGen
extends Object
implements Constants
Template class for building up a java class. May be initialized by an existing java class (file).

See Also:
JavaClass

Variable Index

 o access_flags
 o attribute_vec
 o class_name
 o class_name_index
 o cp
 o field_vec
 o file_name
 o interface_vec
 o method_vec
 o super_class_name
 o superclass_name_index

Constructor Index

 o ClassGen(JavaClass)
Initialize with existing class.
 o ClassGen(String, String, String, int, String[])

Method Index

 o addAttribute(Attribute)
Add an attribute to this class.
 o addField(Field)
Add a field to this class.
 o addInterface(int)
Add an interface to this class, i.e.
 o addInterface(String)
Add an interface to this class, i.e.
 o addMethod(Method)
Add a method to this class.
 o getAccessFlags()
 o getClassName()
 o getConstantPool()
 o getFileName()
 o getJavaClass()
 o getSuperclassName()
 o removeAttribute(Attribute)
Remove an attribute from this class.
 o removeField(Field)
Remove a field to this class.
 o removeMethod(Method)
Remove a method from this class.

Variables

 o class_name
 private String class_name
 o super_class_name
 private String super_class_name
 o file_name
 private String file_name
 o class_name_index
 private int class_name_index
 o superclass_name_index
 private int superclass_name_index
 o access_flags
 private int access_flags
 o cp
 private ConstantPoolGen cp
 o field_vec
 private Vector field_vec
 o method_vec
 private Vector method_vec
 o attribute_vec
 private Vector attribute_vec
 o interface_vec
 private Vector interface_vec

Constructors

 o ClassGen
 public ClassGen(String class_name,
                 String super_class_name,
                 String file_name,
                 int access_flags,
                 String interfaces[])
Parameters:
class_name - fully qualified class name
super_class_name - fully qualified superclass name
file_name - source file name
access_flags - access qualifiers
interfaces - implemented interfaces
 o ClassGen
 public ClassGen(JavaClass clazz)
Initialize with existing class.

Parameters:
clazz - JavaClass object (e.g. read from file)

Methods

 o getJavaClass
 public JavaClass getJavaClass()
Returns:
the (finally) built up Java class object.
 o addInterface
 public final void addInterface(String i)
Add an interface to this class, i.e. this class has to implement it.

Parameters:
i - interface to implement (fully qualified class name)
 o addInterface
 private final void addInterface(int i)
Add an interface to this class, i.e. this class has to implement it.

Parameters:
i - interface to implement (index in constant pool)
 o addAttribute
 public final void addAttribute(Attribute a)
Add an attribute to this class.

Parameters:
a - attribute to add
 o addMethod
 public final void addMethod(Method m)
Add a method to this class.

Parameters:
m - method to add
 o addField
 public final void addField(Field f)
Add a field to this class.

Parameters:
f - field to add
 o removeAttribute
 public final void removeAttribute(Attribute a)
Remove an attribute from this class.

Parameters:
a - attribute to remove
 o removeMethod
 public final void removeMethod(Method m)
Remove a method from this class.

Parameters:
m - method to remove
 o removeField
 public final void removeField(Field f)
Remove a field to this class.

Parameters:
f - field to remove
 o getClassName
 public String getClassName()
 o getSuperclassName
 public String getSuperclassName()
 o getFileName
 public String getFileName()
 o getAccessFlags
 public int getAccessFlags()
 o getConstantPool
 public ConstantPoolGen getConstantPool()

All Packages  Class Hierarchy  This Package  Previous  Next  Index