JavaClass
Modifier and Type | Field and Description |
---|---|
private final List | |
private final List | |
private static BCELComparator | |
private String | |
private int | |
private ConstantPoolGen | |
private final List | |
private final String | |
private final List | |
private int | |
private final List | |
private int | |
private List | |
private String | |
private int |
Access | Constructor and Description |
---|---|
public | |
public | ClassGen(final String
fully qualified class name className, final String fully qualified superclass name superClassName, final String source file name fileName, final int access qualifiers accessFlags, final String[] implemented interfaces interfaces)Convenience constructor to set up some important values initially. |
public | ClassGen(final String
fully qualified class name className, final String fully qualified superclass name superClassName, final String source file name fileName, final int access qualifiers accessFlags, final String[] implemented interfaces interfaces, final ConstantPoolGen constant pool to use cp)Convenience constructor to set up some important values initially. |
Modifier and Type | Method and Description |
---|---|
public void | |
public void | |
public void | |
public void | |
public void | addInterface(final String
interface to implement (fully qualified class name) name)Add an interface to this class, i.e., this class has to implement it. |
public void | |
public void | |
public Object | |
public boolean | |
public Field | |
public Method | Returns: method object with given name and signature, or null
|
public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
public AnnotationEntryGen[] | |
public Attribute[] | |
public String | |
public int | |
public static BCELComparator | |
public ConstantPoolGen | |
public Field[] | |
public String | |
public String[] | |
public int[] | |
public JavaClass | |
public int | |
public Method | |
public Method[] | |
public int | |
public String | |
public int | |
public int | hashCode()
Overrides java. |
public void | |
public void | |
public void | removeInterface(final String
interface to remove (fully qualified name) name)Remove an interface from this class. |
public void | |
public void | |
public void | |
public void | |
public void | |
public void | |
public static void | |
public void | |
public void | setMajor(final int
major version number major)Set major version number of class file, default value is 45 (JDK 1.1) |
public void | |
public void | |
public void | setMinor(final int
minor version number minor)Set minor version number of class file, default value is 3 (JDK 1.1) |
public void | |
public void | |
private AnnotationEntryGen[] | unpackAnnotations(final Attribute[] attrs)
Look for attributes representing annotations and unpack them. |
public void |
annotationList | back to summary |
---|---|
private final List<AnnotationEntryGen> annotationList |
attributeList | back to summary |
---|---|
private final List<Attribute> attributeList |
bcelComparator | back to summary |
---|---|
private static BCELComparator bcelComparator |
className | back to summary |
---|---|
private String className |
classNameIndex | back to summary |
---|---|
private int classNameIndex |
cp | back to summary |
---|---|
private ConstantPoolGen cp |
fieldList | back to summary |
---|---|
private final List<Field> fieldList |
fileName | back to summary |
---|---|
private final String fileName |
interfaceList | back to summary |
---|---|
private final List<String> interfaceList |
major | back to summary |
---|---|
private int major |
methodList | back to summary |
---|---|
private final List<Method> methodList |
minor | back to summary |
---|---|
private int minor |
observers | back to summary |
---|---|
private List<ClassObserver> observers |
superClassName | back to summary |
---|---|
private String superClassName |
superclassNameIndex | back to summary |
---|---|
private int superclassNameIndex |
ClassGen | back to summary |
---|---|
public ClassGen(final JavaClass clazz) Initialize with existing class.
|
ClassGen | back to summary |
---|---|
public ClassGen(final String className, final String superClassName, final String fileName, final int accessFlags, final String[] interfaces) Convenience constructor to set up some important values initially. |
ClassGen | back to summary |
---|---|
public ClassGen(final String className, final String superClassName, final String fileName, final int accessFlags, final String[] interfaces, final ConstantPoolGen cp) Convenience constructor to set up some important values initially.
|
addAnnotationEntry | back to summary |
---|---|
public void addAnnotationEntry(final AnnotationEntryGen a) |
addAttribute | back to summary |
---|---|
public void addAttribute(final Attribute a) Add an attribute to this class.
|
addEmptyConstructor | back to summary |
---|---|
public void addEmptyConstructor(final int accessFlags) Convenience method. Add an empty constructor to this class that does nothing but calling super().
|
addField | back to summary |
---|---|
public void addField(final Field f) Add a field to this class.
|
addInterface | back to summary |
---|---|
public void addInterface(final String name) Add an interface to this class, i.e., this class has to implement it.
|
addMethod | back to summary |
---|---|
public void addMethod(final Method m) Add a method to this class.
|
addObserver | back to summary |
---|---|
public void addObserver(final ClassObserver o) Add observer for this object. |
clone | back to summary |
---|---|
public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true , but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true , this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by |
containsField | back to summary |
---|---|
public boolean containsField(final Field f) |
containsField | back to summary |
---|---|
public Field containsField(final String name)
|
containsMethod | back to summary |
---|---|
public Method containsMethod(final String name, final String signature)
|
equals | back to summary |
---|---|
public boolean equals(final Object obj) Overrides java. Return value as defined by given BCELComparator strategy. By default two ClassGen objects are said to be equal when their class names are equal.
|
getAnnotationEntries | back to summary |
---|---|
public AnnotationEntryGen[] getAnnotationEntries() |
getAttributes | back to summary |
---|---|
public Attribute[] getAttributes() |
getClassName | back to summary |
---|---|
public String getClassName() |
getClassNameIndex | back to summary |
---|---|
public int getClassNameIndex() |
getComparator | back to summary |
---|---|
public static BCELComparator getComparator()
|
getConstantPool | back to summary |
---|---|
public ConstantPoolGen getConstantPool() |
getFields | back to summary |
---|---|
public Field[] getFields() |
getFileName | back to summary |
---|---|
public String getFileName() |
getInterfaceNames | back to summary |
---|---|
public String[] getInterfaceNames() |
getInterfaces | back to summary |
---|---|
public int[] getInterfaces() |
getJavaClass | back to summary |
---|---|
public JavaClass getJavaClass()
|
getMajor | back to summary |
---|---|
public int getMajor()
|
getMethodAt | back to summary |
---|---|
public Method getMethodAt(final int pos) |
getMethods | back to summary |
---|---|
public Method[] getMethods() |
getMinor | back to summary |
---|---|
public int getMinor()
|
getSuperclassName | back to summary |
---|---|
public String getSuperclassName() |
getSuperclassNameIndex | back to summary |
---|---|
public int getSuperclassNameIndex() |
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Return value as defined by given BCELComparator strategy. By default return the hashcode of the class name.
|
removeAttribute | back to summary |
---|---|
public void removeAttribute(final Attribute a) Remove an attribute from this class.
|
removeField | back to summary |
---|---|
public void removeField(final Field f) Remove a field to this class.
|
removeInterface | back to summary |
---|---|
public void removeInterface(final String name) Remove an interface from this class.
|
removeMethod | back to summary |
---|---|
public void removeMethod(final Method m) Remove a method from this class.
|
removeObserver | back to summary |
---|---|
public void removeObserver(final ClassObserver o) Remove observer for this object. |
replaceField | back to summary |
---|---|
public void replaceField(final Field old, final Field newField) Replace given field with new one. If the old one does not exist add the new_ field to the class anyway. |
replaceMethod | back to summary |
---|---|
public void replaceMethod(final Method old, final Method newMethod) Replace given method with new one. If the old one does not exist add the newMethod method to the class anyway. |
setClassName | back to summary |
---|---|
public void setClassName(final String name) |
setClassNameIndex | back to summary |
---|---|
public void setClassNameIndex(final int classNameIndex) |
setComparator | back to summary |
---|---|
public static void setComparator(final BCELComparator comparator)
|
setConstantPool | back to summary |
---|---|
public void setConstantPool(final ConstantPoolGen constantPool) |
setMajor | back to summary |
---|---|
public void setMajor(final int major) Set major version number of class file, default value is 45 (JDK 1.1)
|
setMethodAt | back to summary |
---|---|
public void setMethodAt(final Method method, final int pos) |
setMethods | back to summary |
---|---|
public void setMethods(final Method[] methods) |
setMinor | back to summary |
---|---|
public void setMinor(final int minor) Set minor version number of class file, default value is 3 (JDK 1.1)
|
setSuperclassName | back to summary |
---|---|
public void setSuperclassName(final String name) |
setSuperclassNameIndex | back to summary |
---|---|
public void setSuperclassNameIndex(final int superclassNameIndex) |
unpackAnnotations | back to summary |
---|---|
private AnnotationEntryGen[] unpackAnnotations(final Attribute[] attrs) Look for attributes representing annotations and unpack them. |
update | back to summary |
---|---|
public void update() 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 they have finished editing the object. |