Public Member Functions | Protected Member Functions

org.exolab.javasource.JMethodSignature Class Reference

List of all members.

Public Member Functions

 JMethodSignature (String name, JType returnType)
void addException (JClass exp)
void addParameter (JParameter parameter) throws IllegalArgumentException
JClass[] getExceptions ()
JDocComment getJDocComment ()
JModifiers getModifiers ()
String getName ()
JParameter getParameter (int index)
synchronized JParameter[] getParameters ()
JType getReturnType ()
void setName (String name)
void setComment (String comment)
void setModifiers (JModifiers modifiers)
void print (JSourceWriter jsw)
void print (JSourceWriter jsw, boolean printJavaDoc)
String toString ()

Protected Member Functions

String[] getParameterClassNames ()

Detailed Description

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:
1.4
Date:
2004/12/03 18:51:24

Constructor & Destructor Documentation

org.exolab.javasource.JMethodSignature.JMethodSignature ( String  name,
JType  returnType 
)

Creates a new method with the given name and return type. For "void" return types, simply pass in null as the returnType

Parameters:
name,the method name. Must not be null.
returnType the return type of the method. May be null.

References org.exolab.javasource.JDocComment.addDescriptor(), and org.exolab.javasource.JType.getLocalName().


Member Function Documentation

void org.exolab.javasource.JMethodSignature.addException ( JClass  exp  ) 

Adds the given Exception to this JMethodSignature's throws clause.

Parameters:
exp the JClass representing the Exception

References org.exolab.javasource.JStructure.getName().

Referenced by org.exolab.javasource.JMethod.addException().

void org.exolab.javasource.JMethodSignature.addParameter ( JParameter  parameter  )  throws IllegalArgumentException

Adds the given parameter to this JMethodSignature's list of parameters.

Parameters:
parameter the parameter to add to the this Methods list of parameters.
Exceptions:
IllegalArgumentException when a parameter already exists for this Method with the same name as the new parameter.

References org.exolab.javasource.JDocComment.addDescriptor(), org.exolab.javasource.JNamedMap.get(), and org.exolab.javasource.JNamedMap.put().

Referenced by org.exolab.javasource.JMethod.addParameter().

JClass [] org.exolab.javasource.JMethodSignature.getExceptions (  ) 

Returns the exceptions that this JMethodSignature lists in it's throws clause.

Returns:
the exceptions that this JMethodSignature lists in it's throws clause.

Referenced by org.exolab.javasource.JMethod.getExceptions().

JDocComment org.exolab.javasource.JMethodSignature.getJDocComment (  ) 

Returns the JDocComment describing this JMethodSignature

Returns:
the JDocComment describing this JMethodSignature

Referenced by org.exolab.javasource.JMethod.JMethod().

JModifiers org.exolab.javasource.JMethodSignature.getModifiers (  ) 
String org.exolab.javasource.JMethodSignature.getName (  ) 

Returns the name of the method.

Returns:
the name of the method.

Referenced by org.exolab.javasource.JInterface.addMethod(), org.exolab.javasource.JInterface.getMethod(), and org.exolab.javasource.JMethod.getName().

JParameter org.exolab.javasource.JMethodSignature.getParameter ( int  index  ) 

Returns the JParameter at the given index.

Parameters:
index the index of the JParameter to return.
Returns:
the JParameter at the given index.

References org.exolab.javasource.JNamedMap.get().

Referenced by org.exolab.javasource.JMethod.getParameter().

String [] org.exolab.javasource.JMethodSignature.getParameterClassNames (  )  [protected]
synchronized JParameter [] org.exolab.javasource.JMethodSignature.getParameters (  ) 

Returns the set of JParameters for this JMethodSignature
Note: the array is a copy, the params in the array are the actual references.

Returns:
the set of JParameters for this JMethod

References org.exolab.javasource.JNamedMap.get(), and org.exolab.javasource.JNamedMap.size().

Referenced by org.exolab.javasource.JMethod.getParameters().

JType org.exolab.javasource.JMethodSignature.getReturnType (  ) 

Returns the JType that represents the return type for the method signature.

Returns:
the JType that represents the return type for the method signature.

Referenced by org.exolab.javasource.JMethod.getReturnType().

void org.exolab.javasource.JMethodSignature.print ( JSourceWriter  jsw,
boolean  printJavaDoc 
)
void org.exolab.javasource.JMethodSignature.print ( JSourceWriter  jsw  ) 

Prints the method signature. A semi-colon (end-of-statement terminator ';') will Not be printed.

Parameters:
jsw the JSourceWriter to print to.

Referenced by org.exolab.javasource.JMethod.print(), and org.exolab.javasource.JInterface.print().

void org.exolab.javasource.JMethodSignature.setComment ( String  comment  ) 

Sets the comment describing this JMethodSignature.

Parameters:
comment the comment for this member
See also:
getJDocComment

References org.exolab.javasource.JDocComment.setComment().

void org.exolab.javasource.JMethodSignature.setModifiers ( JModifiers  modifiers  ) 

Sets the JModifiers for this method signature.

Parameters:
modifiers the JModifiers for this method signature.

References org.exolab.javasource.JModifiers.copy(), and org.exolab.javasource.JModifiers.setFinal().

Referenced by org.exolab.javasource.JMethod.setModifiers().

void org.exolab.javasource.JMethodSignature.setName ( String  name  ) 

Sets the name of the method.

Parameters:
name the name of the method

Referenced by org.exolab.javasource.JMethod.setName().

String org.exolab.javasource.JMethodSignature.toString (  ) 

Returns the String representation of this JMethod, which is the method prototype.

Returns:
the String representation of this JMethod, which is simply the method prototype

References org.exolab.javasource.JNamedMap.get(), org.exolab.javasource.JType.getName(), org.exolab.javasource.JParameter.getType(), and org.exolab.javasource.JNamedMap.size().

Referenced by org.exolab.javasource.JMethod.toString().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties