A class which holds information about the signtaure of a JMethod. The code in
this package was modelled after the Java Reflection API as much as possible
to reduce the learning curve.
author: Keith Visco version: $Revision: 6677 $ $Date: 2004-12-03 11:57:33 -0700 (Fri, 03 Dec 2004) $
Constructor Summary
public
JMethodSignature(String name) Creates a new method with the given name and "void" return type.
Parameters: name - The method name.
public
JMethodSignature(String name, JType returnType) Creates a new method with the given name and return type.
Parameters: name - The method name.
Method Summary
public void
addException(JClass exp) Adds the given Exception to this JMethodSignature's throws clause.
public void
addParameter(JParameter parameter) Adds the given parameter to this JMethodSignature's list of parameters.
Creates a new method with the given name and return type.
Parameters: name - The method name. Must not be null. Parameters: returnType - The return type of the method. Must not be null.
Adds the given parameter to this JMethodSignature's list of parameters.
Parameters: parameter - The parameter to add to the this JMethodSignature's listof parameters.
Returns an array containing the names of the classes of the parameters in
this JMethodSignature. For Arrays, the class name of the object type
stored in the Array is what is returned. Parameters that are primitive
types (and Arrays of primitive types) are not represented in the array of
names returned.
An array containing the names of the classes of the parameters inthis JMethodSignature.
Returns the set of JParameters in this JMethodSignature.
Note: the array is a copy, the parameters in the array are the
actual references.
The set of JParameters in this JMethodSignature.
Prints the method signature. A semi-colon (end-of-statement terminator ';')
will not be printed.
Parameters: jsw - The JSourceWriter to print to. Parameters: printJavaDoc - If true, print the JDocComment associated with thismethod signature before we print the method signature.