Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ClassGen Class Reference

Inheritance diagram for ClassGen:
[legend]
Collaboration diagram for ClassGen:
[legend]
List of all members.

Public Methods

 ClassGen (JavaClass clazz)
 ClassGen (String class_name, String super_class_name, String file_name, int access_flags, String[] interfaces)
void addAttribute (Attribute a)
void addEmptyConstructor (int access_flags)
void addField (Field f)
void addInterface (int i)
void addInterface (String i)
void addMethod (Method m)
boolean containsField (Field f)
Field containsField (String name)
Method containsMethod (String name, String signature)
Attribute[] getAttributes ()
String getClassName ()
int getClassNameIndex ()
ConstantPoolGen getConstantPool ()
Field[] getFields ()
String getFileName ()
int[] getInterfaces ()
JavaClass getJavaClass ()
Method[] getMethods ()
String getSuperclassName ()
int getSuperclassNameIndex ()
void removeAttribute (Attribute a)
void removeField (Field f)
void removeInterface (int i)
void removeMethod (Method m)
void setClassNameIndex (int class_name_index)
void setConstantPool (ConstantPoolGen constant_pool)
void setMethods (Method[] methods)
void setSuperclassNameIndex (int superclass_name_index)
 ClassGen (JavaClass clazz)
 ClassGen (String class_name, String super_class_name, String file_name, int access_flags, String[] interfaces)
void addAttribute (Attribute a)
void addEmptyConstructor (int access_flags)
void addField (Field f)
void addInterface (String name)
void addMethod (Method m)
void addObserver (ClassObserver o)
Object clone ()
boolean containsField (Field f)
Field containsField (String name)
Method containsMethod (String name, String signature)
Attribute[] getAttributes ()
String getClassName ()
int getClassNameIndex ()
ConstantPoolGen getConstantPool ()
Field[] getFields ()
String getFileName ()
String[] getInterfaceNames ()
int[] getInterfaces ()
JavaClass getJavaClass ()
int getMajor ()
Method getMethodAt (int pos)
Method[] getMethods ()
int getMinor ()
String getSuperclassName ()
int getSuperclassNameIndex ()
void removeAttribute (Attribute a)
void removeField (Field f)
void removeInterface (String name)
void removeMethod (Method m)
void removeObserver (ClassObserver o)
void replaceField (Field old, Field new_)
void replaceMethod (Method old, Method new_)
void setClassName (String name)
void setClassNameIndex (int class_name_index)
void setConstantPool (ConstantPoolGen constant_pool)
void setMajor (int major)
void setMethodAt (Method method, int pos)
void setMethods (Method[] methods)
void setMinor (int minor)
void setSuperclassName (String name)
void setSuperclassNameIndex (int superclass_name_index)
void update ()

Private Attributes

String class_name
String super_class_name
String file_name
int class_name_index = -1
int superclass_name_index = -1
ConstantPoolGen cp
Vector field_vec = new Vector()
Vector method_vec = new Vector()
Vector attribute_vec = new Vector()
Vector interface_vec = new Vector()
int major = Constants.MAJOR_1_1
int minor = Constants.MINOR_1_1
Vector observers

Detailed Description

Template class for building up a java class. May be initialized by an existing java class (file).

See also:
JavaClass
Version:
Id:
ClassGen.java,v 1.1.1.1 2002/01/24 03:44:04 pserver Exp
Author:
M. Dahm

Definition at line 15 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.


Constructor & Destructor Documentation

ClassGen::ClassGen JavaClass   clazz [inline]
 

Initialize with existing class.

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

Definition at line 39 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

ClassGen::ClassGen String   class_name,
String   super_class_name,
String   file_name,
int   access_flags,
String   interfaces[]
[inline]
 

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

Definition at line 72 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

ClassGen::ClassGen JavaClass   clazz [inline]
 

Initialize with existing class.

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

Definition at line 37 of file src/de/fub/bytecode/generic/ClassGen.java.

ClassGen::ClassGen String   class_name,
String   super_class_name,
String   file_name,
int   access_flags,
String   interfaces[]
[inline]
 

Convenience constructor to set up some important values initially.

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

Definition at line 73 of file src/de/fub/bytecode/generic/ClassGen.java.


Member Function Documentation

void ClassGen::addAttribute Attribute   a [inline]
 

Add an attribute to this class.

Parameters:
a   attribute to add

Definition at line 95 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addAttribute Attribute   a [inline]
 

Add an attribute to this class.

Parameters:
a   attribute to add

Definition at line 94 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addEmptyConstructor int   access_flags [inline]
 

Convenience method.

Add an empty constructor to this class that does nothing but calling super().

Parameters:
access   rights for constructor

Definition at line 102 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addEmptyConstructor int   access_flags [inline]
 

Convenience method.

Add an empty constructor to this class that does nothing but calling super().

Parameters:
access   rights for constructor

Definition at line 101 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addField Field   f [inline]
 

Add a field to this class.

Parameters:
f   field to add

Definition at line 118 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addField Field   f [inline]
 

Add a field to this class.

Parameters:
f   field to add

Definition at line 117 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addInterface String   name [inline]
 

Add an interface to this class, i.e., this class has to implement it.

Parameters:
name   interface to implement (fully qualified class name)

Definition at line 123 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addInterface String   i [inline]
 

Add an interface to this class, i.e. this class has to implement it.

Parameters:
i   interface to implement (fully qualified class name)

Definition at line 129 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addInterface int   i [inline]
 

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)

Definition at line 122 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addMethod Method   m [inline]
 

Add a method to this class.

Parameters:
m   method to add

Definition at line 130 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addMethod Method   m [inline]
 

Add a method to this class.

Parameters:
m   method to add

Definition at line 136 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::addObserver ClassObserver   o [inline]
 

Add observer for this object.

Definition at line 133 of file src/de/fub/bytecode/generic/ClassGen.java.

Field ClassGen::containsField String   name [inline]
 

Returns:
field object with given name, or null

Definition at line 150 of file src/de/fub/bytecode/generic/ClassGen.java.

Method ClassGen::containsMethod String   name,
String   signature
[inline]
 

Returns:
method object with given name and signature, or null

Definition at line 161 of file src/de/fub/bytecode/generic/ClassGen.java.

JavaClass ClassGen::getJavaClass   [inline]
 

Returns:
the (finally) built up Java class object.

Definition at line 203 of file src/de/fub/bytecode/generic/ClassGen.java.

JavaClass ClassGen::getJavaClass   [inline]
 

Returns:
the (finally) built up Java class object.

Definition at line 182 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

int ClassGen::getMajor   [inline]
 

Returns:
major version number of class file

Definition at line 219 of file src/de/fub/bytecode/generic/ClassGen.java.

int ClassGen::getMinor   [inline]
 

Returns:
minor version number of class file

Definition at line 231 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeAttribute Attribute   a [inline]
 

Remove an attribute from this class.

Parameters:
a   attribute to remove

Definition at line 238 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeAttribute Attribute   a [inline]
 

Remove an attribute from this class.

Parameters:
a   attribute to remove

Definition at line 199 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeField Field   f [inline]
 

Remove a field to this class.

Parameters:
f   field to remove

Definition at line 243 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeField Field   f [inline]
 

Remove a field to this class.

Parameters:
f   field to remove

Definition at line 204 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeInterface String   name [inline]
 

Remove an interface from this class.

Parameters:
name   interface to remove (fully qualified name)

Definition at line 248 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeInterface int   i [inline]
 

Remove an interface from this class.

Parameters:
i   interface to remove (index in constant pool)

Definition at line 209 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeMethod Method   m [inline]
 

Remove a method from this class.

Parameters:
m   method to remove

Definition at line 255 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeMethod Method   m [inline]
 

Remove a method from this class.

Parameters:
m   method to remove

Definition at line 218 of file lib/jpf/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::removeObserver ClassObserver   o [inline]
 

Remove observer for this object.

Definition at line 258 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::replaceField Field   old,
Field   new_
[inline]
 

Replace given field with new one. If the old one does not exist add the new_ field to the class anyway.

Definition at line 265 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::replaceMethod Method   old,
Method   new_
[inline]
 

Replace given method with new one. If the old one does not exist add the new_ method to the class anyway.

Definition at line 279 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::setMajor int   major [inline]
 

Set major version number of class file, default value is 45 (JDK 1.1)

Parameters:
major   major version number

Definition at line 305 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::setMinor int   minor [inline]
 

Set minor version number of class file, default value is 3 (JDK 1.1)

Parameters:
minor   minor version number

Definition at line 319 of file src/de/fub/bytecode/generic/ClassGen.java.

void ClassGen::update   [inline]
 

Call notify() method on all observers. This method is not called automatically whenever the state has changed, but has to be called by the user after he has finished editing the object.

Definition at line 335 of file src/de/fub/bytecode/generic/ClassGen.java.


The documentation for this class was generated from the following files:
Generated at Thu Feb 7 07:06:23 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001