Package org.aspectj.apache.bcel.generic
Klasse ClassGen
java.lang.Object
org.aspectj.apache.bcel.classfile.Modifiers
org.aspectj.apache.bcel.generic.ClassGen
- Alle implementierten Schnittstellen:
Cloneable
Template class for building up a java class. May be initialized with an existing java class.
- Version:
- $Id: ClassGen.java,v 1.15 2009/09/15 19:40:14 aclement Exp $
- Autor:
- M. Dahm Upgraded, Andy Clement 9th Mar 06 - calculates SUID
- Siehe auch:
-
Feldübersicht
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidvoidvoidaddEmptyConstructor(int access_flags) Convenience method.voidAdd a field to this class.voidaddInterface(String name) voidclone()booleancontainsMethod(String name, String signature) findsField(String name) getAttribute(String attributeName) intField[]String[]int[]intgetMajor()getMethodAt(int pos) Method[]intgetMinor()longgetSUID()Calculate the SerialVersionUID for a class.intbooleanhasAttribute(String attributeName) final booleanfinal booleanisEnum()voidvoidvoidremoveField(Field f) voidremoveInterface(String name) voidvoidreplaceField(Field old, Field new_) Replace given field with new one.voidreplaceMethod(Method old, Method new_) Replace given method with new one.voidsetClassName(String name) voidsetClassNameIndex(int class_name_index) voidsetConstantPool(ConstantPool constant_pool) voidvoidsetMajor(int major) voidsetMethodAt(Method method, int pos) voidsetMethods(Method[] methods) voidsetMinor(int minor) voidsetSuperclassName(String name) voidsetSuperclassNameIndex(int superclass_name_index) Von Klasse geerbte Methoden org.aspectj.apache.bcel.classfile.Modifiers
getModifiers, isAbstract, isBridge, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVarargs, isVolatile, setModifiers
-
Konstruktordetails
-
ClassGen
public ClassGen(String classname, String superclassname, String filename, int modifiers, String[] interfacenames, ConstantPool cpool) -
ClassGen
-
ClassGen
-
-
Methodendetails
-
getJavaClass
- Gibt zurück:
- build and return a JavaClass
-
addInterface
-
removeInterface
-
getMajor
public int getMajor() -
setMajor
public void setMajor(int major) -
setMinor
public void setMinor(int minor) -
getMinor
public int getMinor() -
addAttribute
-
addAnnotation
-
addMethod
-
addEmptyConstructor
public void addEmptyConstructor(int access_flags) Convenience method. Add an empty constructor to this class that does nothing but calling super().- Parameter:
access- rights for constructor
-
addField
Add a field to this class.- Parameter:
f- field to add
-
containsField
-
findsField
- Gibt zurück:
- field object with given name, or null if not found
-
containsMethod
- Gibt zurück:
- method object with given name and signature, or null if not found
-
removeAttribute
-
removeAnnotation
-
removeMethod
-
replaceMethod
Replace given method with new one. If the old one does not exist add the new_ method to the class anyway. -
replaceField
Replace given field with new one. If the old one does not exist add the new_ field to the class anyway. -
removeField
-
getClassName
-
getSuperclassName
-
getFileName
-
setClassName
-
setSuperclassName
-
getMethods
-
setMethods
-
setFields
-
setMethodAt
-
getMethodAt
-
getInterfaceNames
-
getInterfaces
public int[] getInterfaces() -
getFields
-
getAttributes
-
getAnnotations
-
getConstantPool
-
setConstantPool
-
setClassNameIndex
public void setClassNameIndex(int class_name_index) -
setSuperclassNameIndex
public void setSuperclassNameIndex(int superclass_name_index) -
getSuperclassNameIndex
public int getSuperclassNameIndex() -
getClassNameIndex
public int getClassNameIndex() -
clone
-
isAnnotation
public final boolean isAnnotation() -
isEnum
public final boolean isEnum() -
getSUID
public long getSUID()Calculate the SerialVersionUID for a class. -
hasAttribute
-
getAttribute
-