Top Description Fields Constructors Methods
com.sun.tools.xjc.generator.bean

public abstract Class MethodWriter

extends Object
Class Inheritance
Imports
com.sun.codemodel.JCodeModel, .JDocComment, .JMethod, .JType, .JVar, com.sun.tools.xjc.outline.ClassOutline

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 ([email protected])

Field Summary

Modifier and TypeField and Description
protected final JCodeModel

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract JVar

Returns:

JVar object that represents a newly added parameter on the implementation class.
addParameter
(JType type, String name)

Adds a parameter to the previously declared method.

public final JVar
addParameter(Class<?> type, String name)

public abstract JMethod

Returns:

JMethod object that represents a newly declared method on the implementation class.
declareMethod
(JType returnType, String methodName)

Declares a method in both the interface and the implementation.

public final JMethod
declareMethod(Class<?> returnType, String methodName)

public abstract JDocComment
javadoc()

To generate javadoc for the previously declared method, use this method to obtain a JDocComment object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

codeModelback to summary
protected final JCodeModel codeModel

Constructor Detail

MethodWriterback to summary
protected MethodWriter(ClassOutline context)

Method Detail

addParameterback to summary
public abstract JVar addParameter(JType type, String name)

Adds a parameter to the previously declared method.

Returns:JVar

JVar object that represents a newly added parameter on the implementation class.

addParameterback to summary
public final JVar addParameter(Class<?> type, String name)
declareMethodback to summary
public abstract JMethod declareMethod(JType returnType, String methodName)

Declares a method in both the interface and the implementation.

Returns:JMethod

JMethod object that represents a newly declared method on the implementation class.

declareMethodback to summary
public final JMethod declareMethod(Class<?> returnType, String methodName)
javadocback to summary
public abstract JDocComment javadoc()

To generate javadoc for the previously declared method, use this method to obtain a JDocComment object. This may return a value different from declareMethod().javadoc().