com.sun.tools.xjc.generator.bean
Class MethodWriter

java.lang.Object
  extended by 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
protected  JCodeModel codeModel
           
 
Constructor Summary
protected MethodWriter(ClassOutline context)
           
 
Method Summary
 JVar addParameter(Class type, String name)
           
abstract  JVar addParameter(JType type, String name)
          Adds a parameter to the previously declared method.
 JMethod declareMethod(Class returnType, String methodName)
           
abstract  JMethod declareMethod(JType returnType, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeModel

protected final JCodeModel codeModel
Constructor Detail

MethodWriter

protected MethodWriter(ClassOutline context)
Method Detail

declareMethod

public abstract JMethod declareMethod(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 JMethod declareMethod(Class returnType,
                                   String methodName)

javadoc

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().


addParameter

public abstract JVar addParameter(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.

addParameter

public final JVar addParameter(Class type,
                               String name)


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.