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