- java.lang.Object
-
- com.sun.tools.xjc.generator.bean.MethodWriter
-
public abstract class MethodWriter extends Object
The back-end may or may not generate the content interface separately from the implementation class. If so, a method needs to be declared on both the interface and the implementation class.This class hides those details and allow callers to declare methods just once.
- Author:
- Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected com.sun.codemodel.JCodeModelcodeModel
-
Constructor Summary
Constructors Modifier Constructor Description protectedMethodWriter(ClassOutline context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract com.sun.codemodel.JVaraddParameter(com.sun.codemodel.JType type, String name)Adds a parameter to the previously declared method.com.sun.codemodel.JVaraddParameter(Class type, String name)abstract com.sun.codemodel.JMethoddeclareMethod(com.sun.codemodel.JType returnType, String methodName)Declares a method in both the interface and the implementation.com.sun.codemodel.JMethoddeclareMethod(Class returnType, String methodName)abstract com.sun.codemodel.JDocCommentjavadoc()To generate javadoc for the previously declared method, use this method to obtain aJDocCommentobject.
-
-
-
Constructor Detail
-
MethodWriter
protected MethodWriter(ClassOutline context)
-
-
Method Detail
-
declareMethod
public abstract com.sun.codemodel.JMethod declareMethod(com.sun.codemodel.JType returnType, String methodName)Declares a method in both the interface and the implementation.- Returns:
- JMethod object that represents a newly declared method on the implementation class.
-
declareMethod
public final com.sun.codemodel.JMethod declareMethod(Class returnType, String methodName)
-
javadoc
public abstract com.sun.codemodel.JDocComment javadoc()
To generate javadoc for the previously declared method, use this method to obtain aJDocCommentobject. This may return a value different from declareMethod().javadoc().
-
addParameter
public abstract com.sun.codemodel.JVar addParameter(com.sun.codemodel.JType type, String name)Adds a parameter to the previously declared method.- Returns:
- JVar object that represents a newly added parameter on the implementation class.
-
-