org.exolab.javasource
public final class JMethodSignature extends JAnnotatedElementHelper
Version: $Revision: 6324 $ $Date: 2004-12-03 11:57:33 -0700 (Fri, 03 Dec 2004) $
Constructor Summary | |
---|---|
JMethodSignature(String name)
Creates a new method with the given name and "void" return type.
| |
JMethodSignature(String name, JType returnType)
Creates a new method with the given name and return type.
|
Method Summary | |
---|---|
void | addException(JClass exp)
Adds the given Exception to this JMethodSignature's throws clause.
|
void | addParameter(JParameter parameter)
Adds the given parameter to this JMethodSignature's list of parameters.
|
JClass[] | getExceptions()
Returns the exceptions that this JMethodSignature lists in its throws
clause.
|
JDocComment | getJDocComment()
Returns the JavaDoc comment describing this JMethodSignature.
|
JModifiers | getModifiers()
Returns the modifiers for this JMethodSignature.
|
String | getName()
Returns the name of the method.
|
JParameter | getParameter(int index)
Returns the JParameter at the given index.
|
protected String[] | getParameterClassNames()
Returns an array containing the names of the classes of the parameters in
this JMethodSignature. |
JParameter[] | getParameters()
Returns the set of JParameters in this JMethodSignature.
|
JType | getReturnType()
Returns the JType that represents the return type for the method
signature.
|
void | print(JSourceWriter jsw)
Prints the method signature. |
void | print(JSourceWriter jsw, boolean printJavaDoc)
Prints the method signature. |
void | setComment(String comment)
Sets the JavaDoc comment describing this JMethodSignature.
|
void | setModifiers(JModifiers modifiers)
Sets the JModifiers for this method signature.
|
void | setName(String name)
Sets the name of the method.
|
String | toString()
Returns the String representation of this JMethod, which is the method
prototype.
|
Parameters: name the method name. Must not be null.
Parameters: name the method name. Must not be null. returnType the return type of the method. Must not be null.
Parameters: exp the JClass representing the Exception
Parameters: parameter the parameter to add to the this JMethodSignature's list of parameters.
Returns: the exceptions that this JMethodSignature lists in its throws clause.
Returns: the JavaDoc comment describing this JMethodSignature.
Returns: the modifiers for this JMethodSignature.
Returns: the name of the method.
Parameters: index the index of the JParameter to return
Returns: the JParameter at the given index.
Returns: an array containing the names of the classes of the parameters in this JMethodSignature
Note: the array is a copy, the parameters in the array are the actual references.
Returns: the set of JParameters in this JMethodSignature
Returns: the JType that represents the return type for the method signature.
Parameters: jsw the JSourceWriter to print to.
Parameters: jsw the JSourceWriter to print to. printJavaDoc if true, print the JDocComment associated with this method signature before we print the method signature
Parameters: comment the JavaDoc comment for this member
See Also: JMethodSignature
Parameters: modifiers the JModifiers for this method signature
Parameters: name the name of the method
Returns: the String representation of this JMethod, which is simply the method prototype