Constructor and Description |
---|
ClassGen(JavaClass clazz) |
ClassGen(java.lang.String classname,
java.lang.String superclassname,
java.lang.String filename,
int modifiers,
java.lang.String[] interfacenames) |
ClassGen(java.lang.String classname,
java.lang.String superclassname,
java.lang.String filename,
int modifiers,
java.lang.String[] interfacenames,
ConstantPool cpool) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AnnotationGen a) |
void |
addAttribute(Attribute a) |
void |
addEmptyConstructor(int access_flags)
Convenience method.
|
void |
addField(Field f)
Add a field to this class.
|
void |
addInterface(java.lang.String name) |
void |
addMethod(Method m) |
java.lang.Object |
clone() |
boolean |
containsField(Field f) |
Field |
containsField(java.lang.String name) |
Method |
containsMethod(java.lang.String name,
java.lang.String signature) |
AnnotationGen[] |
getAnnotations() |
Attribute |
getAttribute(java.lang.String attributeName) |
java.util.Collection<Attribute> |
getAttributes() |
java.lang.String |
getClassName() |
int |
getClassNameIndex() |
ConstantPool |
getConstantPool() |
Field[] |
getFields() |
java.lang.String |
getFileName() |
java.lang.String[] |
getInterfaceNames() |
int[] |
getInterfaces() |
JavaClass |
getJavaClass() |
int |
getMajor() |
Method |
getMethodAt(int pos) |
Method[] |
getMethods() |
int |
getMinor() |
long |
getSUID()
Calculate the SerialVersionUID for a class.
|
java.lang.String |
getSuperclassName() |
int |
getSuperclassNameIndex() |
boolean |
hasAttribute(java.lang.String attributeName) |
boolean |
isAnnotation() |
boolean |
isEnum() |
void |
removeAnnotation(AnnotationGen a) |
void |
removeAttribute(Attribute a) |
void |
removeField(Field f) |
void |
removeInterface(java.lang.String name) |
void |
removeMethod(Method m) |
void |
replaceField(Field old,
Field new_)
Replace given field with new one.
|
void |
replaceMethod(Method old,
Method new_)
Replace given method with new one.
|
void |
setClassName(java.lang.String name) |
void |
setClassNameIndex(int class_name_index) |
void |
setConstantPool(ConstantPool constant_pool) |
void |
setFields(Field[] fs) |
void |
setMajor(int major) |
void |
setMethodAt(Method method,
int pos) |
void |
setMethods(Method[] methods) |
void |
setMinor(int minor) |
void |
setSuperclassName(java.lang.String name) |
void |
setSuperclassNameIndex(int superclass_name_index) |
getModifiers, isAbstract, isBridge, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVarargs, isVolatile, setModifiers
public ClassGen(java.lang.String classname, java.lang.String superclassname, java.lang.String filename, int modifiers, java.lang.String[] interfacenames, ConstantPool cpool)
public ClassGen(java.lang.String classname, java.lang.String superclassname, java.lang.String filename, int modifiers, java.lang.String[] interfacenames)
public ClassGen(JavaClass clazz)
public JavaClass getJavaClass()
public void addInterface(java.lang.String name)
public void removeInterface(java.lang.String name)
public int getMajor()
public void setMajor(int major)
public void setMinor(int minor)
public int getMinor()
public void addAttribute(Attribute a)
public void addAnnotation(AnnotationGen a)
public void addMethod(Method m)
public 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)
public void removeAnnotation(AnnotationGen a)
public void removeMethod(Method m)
public void replaceMethod(Method old, Method new_)
public void replaceField(Field old, Field new_)
public void removeField(Field f)
public java.lang.String getClassName()
public java.lang.String getSuperclassName()
public java.lang.String getFileName()
public void setClassName(java.lang.String name)
public void setSuperclassName(java.lang.String name)
public Method[] getMethods()
public void setMethods(Method[] methods)
public void setFields(Field[] fs)
public void setMethodAt(Method method, int pos)
public Method getMethodAt(int pos)
public java.lang.String[] getInterfaceNames()
public int[] getInterfaces()
public Field[] getFields()
public java.util.Collection<Attribute> getAttributes()
public AnnotationGen[] getAnnotations()
public ConstantPool getConstantPool()
public void setConstantPool(ConstantPool constant_pool)
public void setClassNameIndex(int class_name_index)
public void setSuperclassNameIndex(int superclass_name_index)
public int getSuperclassNameIndex()
public int getClassNameIndex()
public java.lang.Object clone()
clone
in class java.lang.Object
public final boolean isAnnotation()
public final boolean isEnum()
public long getSUID()
public boolean hasAttribute(java.lang.String attributeName)
public Attribute getAttribute(java.lang.String attributeName)