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 () |
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.
| 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
| 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().
| void org.exolab.javasource.JMethodSignature.addException | ( | JClass | exp | ) |
Adds the given Exception to this JMethodSignature's throws clause.
| 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.
| parameter | the parameter to add to the this Methods list of parameters. |
| 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.
Referenced by org.exolab.javasource.JMethod.getExceptions().
| JDocComment org.exolab.javasource.JMethodSignature.getJDocComment | ( | ) |
Returns the JDocComment describing this JMethodSignature
Referenced by org.exolab.javasource.JMethod.JMethod().
| JModifiers org.exolab.javasource.JMethodSignature.getModifiers | ( | ) |
Returns the modifiers for this JMethodSignature.
Referenced by org.exolab.javasource.JInterface.addMethod(), org.exolab.javasource.JMethod.getModifiers(), and org.exolab.javasource.JMethod.print().
| String org.exolab.javasource.JMethodSignature.getName | ( | ) |
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.
| index | the index of the JParameter to return. |
References org.exolab.javasource.JNamedMap.get().
Referenced by org.exolab.javasource.JMethod.getParameter().
| String [] org.exolab.javasource.JMethodSignature.getParameterClassNames | ( | ) | [protected] |
References org.exolab.javasource.JNamedMap.get(), org.exolab.javasource.JType.getComponentType(), org.exolab.javasource.JStructure.getName(), org.exolab.javasource.JType.isArray(), org.exolab.javasource.JType.isPrimitive(), and org.exolab.javasource.JNamedMap.size().
Referenced by org.exolab.javasource.JMethod.getParameterClassNames().
| 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.
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.
Referenced by org.exolab.javasource.JMethod.getReturnType().
| void org.exolab.javasource.JMethodSignature.print | ( | JSourceWriter | jsw, | |
| boolean | printJavaDoc | |||
| ) |
Prints the method signature. A semi-colon (end-of-statement terminator ';') will Not be printed.
| jsw | the JSourceWriter to print to. | |
| printJavaDoc | a boolean that when true prints the JDocComment associated with this method signature. |
References org.exolab.javasource.JNamedMap.get(), org.exolab.javasource.JStructure.getName(), org.exolab.javasource.JSourceWriter.indent(), org.exolab.javasource.JDocComment.print(), org.exolab.javasource.JNamedMap.size(), org.exolab.javasource.JParameter.toString(), org.exolab.javasource.JModifiers.toString(), org.exolab.javasource.JSourceWriter.unindent(), org.exolab.javasource.JSourceWriter.write(), and org.exolab.javasource.JSourceWriter.writeln().
| void org.exolab.javasource.JMethodSignature.print | ( | JSourceWriter | jsw | ) |
Prints the method signature. A semi-colon (end-of-statement terminator ';') will Not be printed.
| 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.
| comment | the comment for this member |
References org.exolab.javasource.JDocComment.setComment().
| void org.exolab.javasource.JMethodSignature.setModifiers | ( | JModifiers | modifiers | ) |
Sets the JModifiers for this method signature.
| 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.
| 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.
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().
1.7.0