| Modifier and Type | Field and Description |
|---|---|
| private Set | _throws
Set of exceptions that this method may throw. |
| private List | annotations
Annotations on this variable. |
| private JBlock | body
JBlock of statements that makes up the body this method |
| private JExpression | defaultValue
To set the default value for the annotation member |
| private JDocComment | jdoc
javadoc comments for this JMethod |
| private JMods | mods
Modifiers for this method |
| private String | name
Name of this method |
| private JDefinedClass | |
| private final List | params
List of parameters for this method's declaration |
| private JType | type
Return type for this method |
| private JVar | varParam
Variable parameter for this method's varargs declaration introduced in J2SE 1.5 |
| Access | Constructor and Description |
|---|---|
| pack-priv | JMethod(JDefinedClass outer, int
Modifiers for this method's declaration mods, JType Return type for the method type, String Name of this method name)JMethod constructor |
| pack-priv | JMethod(int
Modifiers for this constructor's declaration mods, JDefinedClass JClass containing this constructor _class)Constructor constructor |
| Modifier and Type | Method and Description |
|---|---|
| public JMethod | |
| public JMethod | |
| public JAnnotationUse | annotate(JClass
The annotation class to annotate the field with clazz)Implements com. Adds an annotation to this variable. |
| public JAnnotationUse | annotate(Class<? extends Annotation>
The annotation class to annotate the field with clazz)Implements com. Adds an annotation to this variable. |
| public <W extends JAnnotationWriter | annotate2(Class<W> clazz)
Implements com. Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations. |
| public Collection | annotations()
Implements com. Read-only live view of all annotations on this |
| public JBlock | |
| public void | declare(JFormatter f)
Overrides com. Implements com.
|
| public void | declareDefaultValue(JExpression
Default value for the annotation member value)Specify the default value for this annotation member |
| private Set | |
| public boolean | |
| public boolean | |
| private boolean | |
| public JDocComment | Returns: JDocComment containing javadocs for this classImplements com. Creates, if necessary, and returns the class javadoc for this JDefinedClass |
| public JVar[] | Returns: If there's no parameter, an empty array will be returned.Returns all the parameters in an array. |
| public JType[] | Returns: If there's no parameter, an empty array will be returned.Returns all the parameter types in an array. |
| public JVar | Returns: If there's no parameter, null will be returned.Returns the variable parameter |
| public JType | Returns: If there's no vararg parameter type, null will be returned.Returns the varags parameter type. |
| public JMods | |
| public String | |
| public void | |
| protected JCodeModel | |
| public JVar | |
| public JVar | |
| public JVar | |
| public JVar | |
| public List | Returns: List of parameters of this method. This list is not modifiable.Returns the list of variable of this method. |
| public boolean | removeAnnotation(JAnnotationUse annotation)
Implements com. Removes annotation from this program element. |
| public JType | |
| public void | |
| public JVar | |
| public JVar |
| _throws | back to summary |
|---|---|
| private Set<JClass> _throws Set of exceptions that this method may throw. A set instance lazily created. | |
| annotations | back to summary |
|---|---|
| private List<JAnnotationUse> annotations Annotations on this variable. Lazily created. | |
| body | back to summary |
|---|---|
| private JBlock body JBlock of statements that makes up the body this method | |
| defaultValue | back to summary |
|---|---|
| private JExpression defaultValue To set the default value for the annotation member | |
| jdoc | back to summary |
|---|---|
| private JDocComment jdoc javadoc comments for this JMethod | |
| mods | back to summary |
|---|---|
| private JMods mods Modifiers for this method | |
| name | back to summary |
|---|---|
| private String name Name of this method | |
| outer | back to summary |
|---|---|
| private JDefinedClass outer | |
| params | back to summary |
|---|---|
| private final List<JVar> params List of parameters for this method's declaration | |
| type | back to summary |
|---|---|
| private JType type Return type for this method | |
| varParam | back to summary |
|---|---|
| private JVar varParam Variable parameter for this method's varargs declaration introduced in J2SE 1.5 | |
| JMethod | back to summary |
|---|---|
| pack-priv JMethod(JDefinedClass outer, int mods, JType type, String name) JMethod constructor | |
| JMethod | back to summary |
|---|---|
| pack-priv JMethod(int mods, JDefinedClass _class) Constructor constructor
| |
| _throws | back to summary |
|---|---|
| public JMethod _throws(JClass exception) Add an exception to the list of exceptions that this method may throw.
| |
| _throws | back to summary |
|---|---|
| public JMethod _throws(Class<? extends Throwable> exception) | |
| annotate | back to summary |
|---|---|
| public JAnnotationUse annotate(JClass clazz) Implements com. Adds an annotation to this variable. | |
| annotate | back to summary |
|---|---|
| public JAnnotationUse annotate(Class<? extends Annotation> clazz) Implements com. Adds an annotation to this variable.
| |
| annotate2 | back to summary |
|---|---|
| public <W extends JAnnotationWriter Implements com. Doc from com. Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.
| |
| annotations | back to summary |
|---|---|
| public Collection Implements com. Doc from com. Read-only live view of all annotations on this
| |
| body | back to summary |
|---|---|
| public JBlock body() Get the block that makes up body of this method
| |
| declare | back to summary |
|---|---|
| public void declare(JFormatter f) Overrides com. Implements com.
| |
| declareDefaultValue | back to summary |
|---|---|
| public void declareDefaultValue(JExpression value) Specify the default value for this annotation member
| |
| getThrows | back to summary |
|---|---|
| private Set | |
| hasSignature | back to summary |
|---|---|
| public boolean hasSignature(JType[] argTypes) Returns true if the method has the specified signature. | |
| hasVarArgs | back to summary |
|---|---|
| public boolean hasVarArgs() Check if there are any varargs declared for this method signature. | |
| isConstructor | back to summary |
|---|---|
| private boolean isConstructor() | |
| javadoc | back to summary |
|---|---|
| public JDocComment javadoc() Implements com. Creates, if necessary, and returns the class javadoc for this JDefinedClass
| |
| listParams | back to summary |
|---|---|
| public JVar[] listParams() Returns all the parameters in an array.
| |
| listParamTypes | back to summary |
|---|---|
| public JType[] listParamTypes() Returns all the parameter types in an array.
| |
| listVarParam | back to summary |
|---|---|
| public JVar listVarParam() Returns the variable parameter
| |
| listVarParamType | back to summary |
|---|---|
| public JType listVarParamType() Returns the varags parameter type.
| |
| mods | back to summary |
|---|---|
public JMods mods()
| |
| name | back to summary |
|---|---|
| public String name() | |
| name | back to summary |
|---|---|
| public void name(String n) Changes the name of the method. | |
| owner | back to summary |
|---|---|
| protected JCodeModel owner() Implements abstract com.
| |
| param | back to summary |
|---|---|
| public JVar param(int mods, JType type, String name) Add the specified variable to the list of parameters for this method signature. | |
| param | back to summary |
|---|---|
| public JVar param(JType type, String name) | |
| param | back to summary |
|---|---|
| public JVar param(int mods, Class<?> type, String name) | |
| param | back to summary |
|---|---|
| public JVar param(Class<?> type, String name) | |
| params | back to summary |
|---|---|
| public List Returns the list of variable of this method. | |
| removeAnnotation | back to summary |
|---|---|
| public boolean removeAnnotation(JAnnotationUse annotation) Implements com. Doc from com. Removes annotation from this program element.
| |
| type | back to summary |
|---|---|
| public JType type() Returns the return type. | |
| type | back to summary |
|---|---|
| public void type(JType t) Overrides the return type. | |
| varParam | back to summary |
|---|---|
public JVar varParam(Class<?> type, String name)
| |
| varParam | back to summary |
|---|---|
| public JVar varParam(JType type, String name) Add the specified variable argument to the list of parameters for this method signature.
| |