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
-
access_flags
-
-
attribute_vec
-
-
class_name
-
-
class_name_index
-
-
cp
-
-
field_vec
-
-
file_name
-
-
interface_vec
-
-
method_vec
-
-
super_class_name
-
-
superclass_name_index
-
-
ClassGen(JavaClass)
- Initialize with existing class.
-
ClassGen(String, String, String, int, String[])
-
-
addAttribute(Attribute)
- Add an attribute to this class.
-
addField(Field)
- Add a field to this class.
-
addInterface(int)
- Add an interface to this class, i.e.
-
addInterface(String)
- Add an interface to this class, i.e.
-
addMethod(Method)
- Add a method to this class.
-
getAccessFlags()
-
-
getClassName()
-
-
getConstantPool()
-
-
getFileName()
-
-
getJavaClass()
-
-
getSuperclassName()
-
-
removeAttribute(Attribute)
- Remove an attribute from this class.
-
removeField(Field)
- Remove a field to this class.
-
removeMethod(Method)
- Remove a method from this class.
class_name
private String class_name
super_class_name
private String super_class_name
file_name
private String file_name
class_name_index
private int class_name_index
superclass_name_index
private int superclass_name_index
access_flags
private int access_flags
cp
private ConstantPoolGen cp
field_vec
private Vector field_vec
method_vec
private Vector method_vec
attribute_vec
private Vector attribute_vec
interface_vec
private Vector interface_vec
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
ClassGen
public ClassGen(JavaClass clazz)
- Initialize with existing class.
- Parameters:
- clazz - JavaClass object (e.g. read from file)
getJavaClass
public JavaClass getJavaClass()
- Returns:
- the (finally) built up Java class object.
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)
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)
addAttribute
public final void addAttribute(Attribute a)
- Add an attribute to this class.
- Parameters:
- a - attribute to add
addMethod
public final void addMethod(Method m)
- Add a method to this class.
- Parameters:
- m - method to add
addField
public final void addField(Field f)
- Add a field to this class.
- Parameters:
- f - field to add
removeAttribute
public final void removeAttribute(Attribute a)
- Remove an attribute from this class.
- Parameters:
- a - attribute to remove
removeMethod
public final void removeMethod(Method m)
- Remove a method from this class.
- Parameters:
- m - method to remove
removeField
public final void removeField(Field f)
- Remove a field to this class.
- Parameters:
- f - field to remove
getClassName
public String getClassName()
getSuperclassName
public String getSuperclassName()
getFileName
public String getFileName()
getAccessFlags
public int getAccessFlags()
getConstantPool
public ConstantPoolGen getConstantPool()
All Packages Class Hierarchy This Package Previous Next Index