|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.fub.bytecode.classfile.AccessFlags | +--de.fub.bytecode.generic.ClassGen
Template class for building up a java class. May be initialized by an existing java class (file).
JavaClass
Fields inherited from class de.fub.bytecode.classfile.AccessFlags |
access_flags |
Constructor Summary | |
ClassGen(JavaClass clazz)
Initialize with existing class. |
|
ClassGen(java.lang.String class_name,
java.lang.String super_class_name,
java.lang.String file_name,
int access_flags,
java.lang.String[] interfaces)
|
Method Summary | |
void |
addAttribute(Attribute a)
Add an attribute to this class. |
void |
addEmptyConstructor(int access_flags)
Convenience method. |
void |
addField(Field f)
Add a field to this class. |
void |
addInterface(int i)
Add an interface to this class, i.e., this class has to implement it. |
void |
addInterface(java.lang.String i)
Add an interface to this class, i.e., this class has to implement it. |
void |
addMethod(Method m)
Add a method to this class. |
boolean |
containsField(Field f)
|
Field |
containsField(java.lang.String name)
|
Method |
containsMethod(java.lang.String name,
java.lang.String signature)
|
Attribute[] |
getAttributes()
|
java.lang.String |
getClassName()
|
int |
getClassNameIndex()
|
ConstantPoolGen |
getConstantPool()
|
Field[] |
getFields()
|
java.lang.String |
getFileName()
|
int[] |
getInterfaces()
|
JavaClass |
getJavaClass()
|
Method[] |
getMethods()
|
java.lang.String |
getSuperclassName()
|
int |
getSuperclassNameIndex()
|
void |
removeAttribute(Attribute a)
Remove an attribute from this class. |
void |
removeField(Field f)
Remove a field to this class. |
void |
removeInterface(int i)
Remove an interface from this class. |
void |
removeMethod(Method m)
Remove a method from this class. |
void |
setClassNameIndex(int class_name_index)
|
void |
setConstantPool(ConstantPoolGen constant_pool)
|
void |
setMethods(Method[] methods)
|
void |
setSuperclassNameIndex(int superclass_name_index)
|
Methods inherited from class de.fub.bytecode.classfile.AccessFlags |
getAccessFlags, isAbstract, isAbstract, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isSynchronized, isSynchronized, isTransient, isTransient, isVolatile, isVolatile, setAccessFlags |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClassGen(java.lang.String class_name, java.lang.String super_class_name, java.lang.String file_name, int access_flags, java.lang.String[] interfaces)
class_name
- fully qualified class namesuper_class_name
- fully qualified superclass namefile_name
- source file nameaccess_flags
- access qualifiersinterfaces
- implemented interfacespublic ClassGen(JavaClass clazz)
clazz
- JavaClass object (e.g. read from file)Method Detail |
public JavaClass getJavaClass()
public void addInterface(java.lang.String i)
i
- interface to implement (fully qualified class name)public void addInterface(int i)
i
- interface to implement (must be index in constant pool pointing to a ConstantClass)public void removeInterface(int i)
i
- interface to remove (index in constant pool)public void addAttribute(Attribute a)
a
- attribute to addpublic void addMethod(Method m)
m
- method to addpublic void addEmptyConstructor(int access_flags)
access
- rights for constructorpublic void addField(Field f)
f
- field to addpublic boolean containsField(Field f)
public Field containsField(java.lang.String name)
public Method containsMethod(java.lang.String name, java.lang.String signature)
public void removeAttribute(Attribute a)
a
- attribute to removepublic void removeMethod(Method m)
m
- method to removepublic void removeField(Field f)
f
- field to removepublic java.lang.String getClassName()
public java.lang.String getSuperclassName()
public java.lang.String getFileName()
public Method[] getMethods()
public void setMethods(Method[] methods)
public int[] getInterfaces()
public Field[] getFields()
public Attribute[] getAttributes()
public ConstantPoolGen getConstantPool()
public void setConstantPool(ConstantPoolGen constant_pool)
public void setClassNameIndex(int class_name_index)
public void setSuperclassNameIndex(int superclass_name_index)
public int getSuperclassNameIndex()
public int getClassNameIndex()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |