| java.lang.Object com.sun.codemodel.JGenerifiableImpl com.sun.codemodel.JMethod
JMethod | JMethod(JDefinedClass outer, int mods, JType type, String name)(Code) | | JMethod constructor
Parameters: mods - Modifiers for this method's declaration Parameters: type - Return type for the method Parameters: name - Name of this method |
JMethod | JMethod(int mods, JDefinedClass _class)(Code) | | Constructor constructor
Parameters: mods - Modifiers for this constructor's declaration Parameters: _class - JClass containing this constructor |
_throws | public JMethod _throws(JClass exception)(Code) | | Add an exception to the list of exceptions that this
method may throw.
Parameters: exception - Name of an exception that this method may throw |
annotate | public JAnnotationUse annotate(JClass clazz)(Code) | | Adds an annotation to this variable.
Parameters: clazz - The annotation class to annotate the field with |
annotate | public JAnnotationUse annotate(Class<? extends Annotation> clazz)(Code) | | Adds an annotation to this variable.
Parameters: clazz - The annotation class to annotate the field with |
body | public JBlock body()(Code) | | Get the block that makes up body of this method
Body of method |
declareDefaultValue | public void declareDefaultValue(JExpression value)(Code) | | Specify the default value for this annotation member
Parameters: value - Default value for the annotation member |
hasSignature | public boolean hasSignature(JType[] argTypes)(Code) | | Returns true if the method has the specified signature.
|
hasVarArgs | public boolean hasVarArgs()(Code) | | Check if there are any varargs declared
for this method signature.
|
javadoc | public JDocComment javadoc()(Code) | | Creates, if necessary, and returns the class javadoc for this
JDefinedClass
JDocComment containing javadocs for this class |
listParamTypes | public JType[] listParamTypes()(Code) | | Returns all the parameter types in an array.
If there's no parameter, an empty array will be returned. |
listParams | public JVar[] listParams()(Code) | | Returns all the parameters in an array.
If there's no parameter, an empty array will be returned. |
listVarParam | public JVar listVarParam()(Code) | | Returns the variable parameter
If there's no parameter, null will be returned. |
listVarParamType | public JType listVarParamType()(Code) | | Returns the varags parameter type.
If there's no vararg parameter type, null will be returned. |
mods | public JMods mods()(Code) | | the current modifiers of this method.Always return non-null valid object. |
name | public void name(String n)(Code) | | Changes the name of the method.
|
param | public JVar param(int mods, JType type, String name)(Code) | | Add the specified variable to the list of parameters
for this method signature.
Parameters: type - JType of the parameter being added Parameters: name - Name of the parameter being added New parameter variable |
type | public void type(JType t)(Code) | | Overrides the return type.
|
varParam | public JVar varParam(JType type, String name)(Code) | | Add the specified variable argument to the list of parameters
for this method signature.
Parameters: type - Type of the parameter being added. Parameters: name - Name of the parameter being added the variable parameter throws: IllegalStateException - If this method is called twice.varargs in J2SE 1.5 can appear only once in the method signature. |
|
|