com.sun.tools.doclets.internal.toolkit.builders
Class MethodBuilder

java.lang.Object
  extended by com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder
      extended by com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder
          extended by com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder

public class MethodBuilder
extends AbstractMemberBuilder

Builds documentation for a method. This code is not part of an API. It is implementation that is subject to change. Do not use it as an API

Since:
1.5

Field Summary
private  ClassDoc classDoc
          The class whose methods are being documented.
private  int currentMethodIndex
          The index of the current field that is being documented at this point in time.
private  java.util.List<ProgramElementDoc> methods
          The methods being documented.
private  VisibleMemberMap visibleMemberMap
          The visible methods for the given class.
private  MethodWriter writer
          The writer to output the method documentation.
 
Fields inherited from class com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder
configuration, containingPackagesSeen, DEBUG
 
Constructor Summary
private MethodBuilder(Configuration configuration)
           
 
Method Summary
 void buildDeprecationInfo()
          Build the deprecation information.
 void buildFooter()
          Build the overall footer.
 void buildHeader()
          Build the overall header.
 void buildMethodComments()
          Build the comments for the method.
 void buildMethodDoc(java.util.List<?> elements)
          Build the method documentation.
 void buildMethodFooter()
          Build the footer of the method.
 void buildMethodHeader()
          Build the header for the individual method.
 void buildSignature()
          Build the signature.
 void buildTagInfo()
          Build the tag information.
static MethodBuilder getInstance(Configuration configuration, ClassDoc classDoc, MethodWriter writer)
          Construct a new MethodBuilder.
 java.lang.String getName()
          Return the name of this builder.
 VisibleMemberMap getVisibleMemberMap()
          Returns the visible member map for the methods of this class.
 MethodWriter getWriter()
          Return the method writer for this builder.
 boolean hasMembersToDocument()
          Return true if this subbuilder has anything to document.
 void invokeMethod(java.lang.String methodName, java.lang.Class<?>[] paramClasses, java.lang.Object[] params)
          Given the name and parameters, invoke the method in the builder.
 java.util.List<ProgramElementDoc> members(ClassDoc classDoc)
          Returns a list of methods that will be documented for the given class.
 
Methods inherited from class com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder
build, build
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentMethodIndex

private int currentMethodIndex
The index of the current field that is being documented at this point in time.


classDoc

private ClassDoc classDoc
The class whose methods are being documented.


visibleMemberMap

private VisibleMemberMap visibleMemberMap
The visible methods for the given class.


writer

private MethodWriter writer
The writer to output the method documentation.


methods

private java.util.List<ProgramElementDoc> methods
The methods being documented.

Constructor Detail

MethodBuilder

private MethodBuilder(Configuration configuration)
Method Detail

getInstance

public static MethodBuilder getInstance(Configuration configuration,
                                        ClassDoc classDoc,
                                        MethodWriter writer)
Construct a new MethodBuilder.

Parameters:
configuration - the current configuration of the doclet.
classDoc - the class whoses members are being documented.
writer - the doclet specific writer.
Returns:
an instance of a MethodBuilder.

getName

public java.lang.String getName()
Return the name of this builder.

Specified by:
getName in class AbstractBuilder
Returns:
the name of the builder.

invokeMethod

public void invokeMethod(java.lang.String methodName,
                         java.lang.Class<?>[] paramClasses,
                         java.lang.Object[] params)
                  throws java.lang.Exception
Given the name and parameters, invoke the method in the builder. This method is required to invoke the appropriate build method as instructed by the builder XML file.

Specified by:
invokeMethod in class AbstractBuilder
Parameters:
methodName - the name of the method that we would like to invoke.
paramClasses - the types for each parameter.
params - the parameters of the method.
Throws:
java.lang.Exception

members

public java.util.List<ProgramElementDoc> members(ClassDoc classDoc)
Returns a list of methods that will be documented for the given class. This information can be used for doclet specific documentation generation.

Parameters:
classDoc - the ClassDoc we want to check.
Returns:
a list of methods that will be documented.

getVisibleMemberMap

public VisibleMemberMap getVisibleMemberMap()
Returns the visible member map for the methods of this class.

Returns:
the visible member map for the methods of this class.

hasMembersToDocument

public boolean hasMembersToDocument()
Return true if this subbuilder has anything to document.

Specified by:
hasMembersToDocument in class AbstractMemberBuilder
Returns:
true if this subbuilder has anything to document.

buildMethodDoc

public void buildMethodDoc(java.util.List<?> elements)
Build the method documentation.


buildHeader

public void buildHeader()
Build the overall header.


buildMethodHeader

public void buildMethodHeader()
Build the header for the individual method.


buildSignature

public void buildSignature()
Build the signature.


buildDeprecationInfo

public void buildDeprecationInfo()
Build the deprecation information.


buildMethodComments

public void buildMethodComments()
Build the comments for the method. Do nothing if Configuration.nocomment is set to true. If this method


buildTagInfo

public void buildTagInfo()
Build the tag information.


buildMethodFooter

public void buildMethodFooter()
Build the footer of the method.


buildFooter

public void buildFooter()
Build the overall footer.


getWriter

public MethodWriter getWriter()
Return the method writer for this builder.

Returns:
the method writer for this builder.