All Packages Class Hierarchy This Package Previous Next Index
Class de.fub.bytecode.generic.ClassGen
java.lang.Object
|
+----de.fub.bytecode.classfile.AccessFlags
|
+----de.fub.bytecode.generic.ClassGen
- public class ClassGen
- extends AccessFlags
- implements Constants
Template class for building up a java class. May be initialized by an
existing java class (file).
- Version:
- $Id: ClassGen.java,v 1.11 1999/08/13 08:18:25 dahm Exp $
- Author:
- M. Dahm
- See Also:
- JavaClass
-
ClassGen(JavaClass)
- Initialize with existing class.
-
ClassGen(String, String, String, int, String[])
-
-
addAttribute(Attribute)
- Add an attribute to this class.
-
addEmptyConstructor(int)
- Convenience method.
-
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.
-
containsField(Field)
-
-
containsField(String)
-
-
containsMethod(String, String)
-
-
getAttributes()
-
-
getClassName()
-
-
getClassNameIndex()
-
-
getConstantPool()
-
-
getFields()
-
-
getFileName()
-
-
getInterfaces()
-
-
getJavaClass()
-
-
getMethods()
-
-
getSuperclassName()
-
-
getSuperclassNameIndex()
-
-
removeAttribute(Attribute)
- Remove an attribute from this class.
-
removeField(Field)
- Remove a field to this class.
-
removeInterface(int)
- Remove an interface from this class.
-
removeMethod(Method)
- Remove a method from this class.
-
setClassNameIndex(int)
-
-
setConstantPool(ConstantPoolGen)
-
-
setMethods(Method[])
-
-
setSuperclassNameIndex(int)
-
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 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
public void addInterface(int i)
- Add an interface to this class, i.e. this class has to implement it.
- Parameters:
- i - interface to implement (must be index in constant pool pointing to a ConstantClass)
removeInterface
public void removeInterface(int i)
- Remove an interface from this class.
- Parameters:
- i - interface to remove (index in constant pool)
addAttribute
public void addAttribute(Attribute a)
- Add an attribute to this class.
- Parameters:
- a - attribute to add
addMethod
public void addMethod(Method m)
- Add a method to this class.
- Parameters:
- m - method to add
addEmptyConstructor
public void addEmptyConstructor(int access_flags)
- Convenience method.
Add an empty constructor to this class that does nothing but calling super().
- Parameters:
- access - rights for constructor
addField
public void addField(Field f)
- Add a field to this class.
- Parameters:
- f - field to add
containsField
public boolean containsField(Field f)
containsField
public Field containsField(String name)
containsMethod
public Method containsMethod(String name,
String signature)
removeAttribute
public void removeAttribute(Attribute a)
- Remove an attribute from this class.
- Parameters:
- a - attribute to remove
removeMethod
public void removeMethod(Method m)
- Remove a method from this class.
- Parameters:
- m - method to remove
removeField
public 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()
getMethods
public Method[] getMethods()
setMethods
public void setMethods(Method methods[])
getInterfaces
public int[] getInterfaces()
getFields
public Field[] getFields()
getAttributes
public Attribute[] getAttributes()
getConstantPool
public ConstantPoolGen getConstantPool()
setConstantPool
public void setConstantPool(ConstantPoolGen constant_pool)
setClassNameIndex
public void setClassNameIndex(int class_name_index)
setSuperclassNameIndex
public void setSuperclassNameIndex(int superclass_name_index)
getSuperclassNameIndex
public int getSuperclassNameIndex()
getClassNameIndex
public int getClassNameIndex()
All Packages Class Hierarchy This Package Previous Next Index