Method Summary |
|
final public void | addConstructor(JConstructor constructor) Adds the given Constructor to this classes list of constructors. |
final public void | addField(JField jField) |
final public void | addMethod(JMethod jMethod, boolean importReturnType) Adds the given JMethod to this JClass.
Parameters: jMethod - The JMethod to add. Parameters: importReturnType - true if we add the importReturnType to the classimport lists. |
final public void | addMethod(JMethod jMethod) Adds the given JMethod to this JClass. |
final public void | addMethods(JMethod[] jMethods) Adds the given array of JMethods to this JClass. |
final public JConstructor | createConstructor() Creates a new JConstructor and adds it to this JClass. |
final public JConstructor | createConstructor(JParameter[] params) Creates a new JConstructor and adds it to this JClass.
Parameters: params - A list of parameters for this constructor. |
final public JClass | createInnerClass(String localname) Creates and returns an inner-class for this JClass.
Parameters: localname - The name of the class (no package name). |
final public JConstructor | getConstructor(int index) Returns the constructor at the specified index.
Parameters: index - The index of the constructor to return. |
final public JConstructor[] | getConstructors() Returns the an array of the JConstructors contained within this JClass. |
final public JField | getField(String name) |
final public JField[] | getFields() |
final public JClass[] | getInnerClasses() Returns an array of JClass (the inner classes) contained within this
JClass. |
final public JMethod | getMethod(String name, int startIndex) Returns the first occurance of the method with the given name, starting
from the specified index.
Parameters: name - The name of the method to look for. Parameters: startIndex - The starting index to begin the search. |
final public JMethod | getMethod(int index) Returns the JMethod located at the specified index.
Parameters: index - The index of the JMethod to return. |
final public JMethod[] | getMethods() Returns an array of all the JMethods of this JClass. |
final public JSourceCode | getStaticInitializationCode() Returns the JSourceCode for the static initializer of this JClass. |
final public void | print(JSourceWriter jsw) |
abstract public void | print(JSourceWriter jsw, boolean classOnly) Prints the source code for this JClass to the given JSourceWriter.
Parameters: classOnly - If true, the file header, package declaration, andimports are not printed. Parameters: jsw - The JSourceWriter to print to. |
final protected void | printClassHeaders(JSourceWriter jsw) Writes to the JSourceWriter the headers for this class file. |
final protected void | printConstructors(JSourceWriter jsw) Writes to the JSourceWriter all constructors for this class. |
final protected void | printInnerClasses(JSourceWriter jsw) Writes to the JSourceWriter all inner classes belonging to this class. |
final protected void | printMemberVariables(JSourceWriter jsw) Writes to the JSourceWriter the member variables of this class. |
final protected void | printMethods(JSourceWriter jsw) Writes to the JSourceWriter all methods belonging to this class. |
final protected void | printStaticInitializers(JSourceWriter jsw) Writes to the JSourceWriter any static initialization used by this class. |
final public boolean | removeConstructor(JConstructor constructor) Removes the given constructor from this JClass.
Parameters: constructor - The JConstructor to remove. |
final public JField | removeField(String name) Removes the field with the given name from this JClass.
Parameters: name - The name of the field to remove. |
final public boolean | removeField(JField jField) Removes the given JField from this JClass.
Parameters: jField - The JField to remove. |
final public boolean | removeInnerClass(JClass jClass) Removes the given inner-class (JClass) from this JClass.
Parameters: jClass - The JClass (inner-class) to remove. |
final public boolean | removeMethod(JMethod method) Removes the given method from this JClass.
Parameters: method - The JMethod to remove. |