public abstract class MethodWriter
extends java.lang.Object
This class hides those details and allow callers to declare methods just once.
Modifier and Type | Field and Description |
---|---|
protected JCodeModel |
codeModel |
Modifier | Constructor and Description |
---|---|
protected |
MethodWriter(ClassOutline context) |
Modifier and Type | Method and Description |
---|---|
JVar |
addParameter(java.lang.Class type,
java.lang.String name) |
abstract JVar |
addParameter(JType type,
java.lang.String name)
Adds a parameter to the previously declared method.
|
JMethod |
declareMethod(java.lang.Class returnType,
java.lang.String methodName) |
abstract JMethod |
declareMethod(JType returnType,
java.lang.String methodName)
Declares a method in both the interface and the implementation.
|
abstract JDocComment |
javadoc()
To generate javadoc for the previously declared method, use this method
to obtain a
JDocComment object. |
protected MethodWriter(ClassOutline context)
public abstract JMethod declareMethod(JType returnType, java.lang.String methodName)
public final JMethod declareMethod(java.lang.Class returnType, java.lang.String methodName)
public abstract JDocComment javadoc()
JDocComment
object. This may return a value
different from declareMethod().javadoc().public abstract JVar addParameter(JType type, java.lang.String name)
public final JVar addParameter(java.lang.Class type, java.lang.String name)