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

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

public class ClassBuilder
extends AbstractBuilder

Builds the summary for a given class. 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 being documented.
private  boolean isEnum
          Keep track of whether or not this classdoc is an enum.
private  boolean isInterface
          Keep track of whether or not this classdoc is an interface.
static java.lang.String ROOT
          The root element of the class XML is "ClassDoc".
private  ClassWriter writer
          The doclet specific writer.
 
Fields inherited from class com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder
configuration, containingPackagesSeen, DEBUG
 
Constructor Summary
private ClassBuilder(Configuration configuration)
          Construct a new ClassBuilder.
 
Method Summary
 void build()
          Build the documentation.
 void buildClassDescription()
          Build the class description.
 void buildClassDoc(java.util.List<?> elements)
          Handles the <ClassDoc> tag.
 void buildClassFooter()
          Build the footer of the page.
 void buildClassHeader()
          Build the header of the page.
 void buildClassSignature()
          Build the signature of the current class.
 void buildClassTagInfo()
          Build the tag information for the current class.
 void buildClassTree()
          Build the class tree documentation.
 void buildConstructorDetails(java.util.List<?> elements)
          Build the constructor documentation.
 void buildDeprecationInfo()
          If this class is deprecated, print the appropriate information.
 void buildEnumConstantsDetails(java.util.List<?> elements)
          Build the enum constants documentation.
 void buildFieldDetails(java.util.List<?> elements)
          Build the field documentation.
 void buildImplementedInterfacesInfo()
          If this is a class, list all interfaces implemented by this class.
 void buildInterfaceUsageInfo()
          If this is an interface, list all classes that implement this interface.
 void buildMemberSummary(java.util.List<?> elements)
          Build the contents of the page.
 void buildMethodDetails(java.util.List<?> elements)
          Build the method documentation.
 void buildNestedClassInfo()
          If this is an inner class or interface, list the enclosing class or interface.
 void buildSubClassInfo()
          List all the classes extend this one.
 void buildSubInterfacesInfo()
          List all the interfaces that extend this one.
 void buildSuperInterfacesInfo()
          If this is an interface, list all super interfaces.
 void buildTypeParamInfo()
          List the parameters of this class.
private  void copyDocFiles()
          Copy the doc files for the current ClassDoc if necessary.
static ClassBuilder getInstance(Configuration configuration, ClassDoc classDoc, ClassWriter writer)
          Construct a new ClassBuilder.
 java.lang.String getName()
          Return the name of this builder.
 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.
 
Methods inherited from class com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder
build
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT

public static final java.lang.String ROOT
The root element of the class XML is "ClassDoc".

See Also:
Constant Field Values

classDoc

private ClassDoc classDoc
The class being documented.


writer

private ClassWriter writer
The doclet specific writer.


isInterface

private boolean isInterface
Keep track of whether or not this classdoc is an interface.


isEnum

private boolean isEnum
Keep track of whether or not this classdoc is an enum.

Constructor Detail

ClassBuilder

private ClassBuilder(Configuration configuration)
Construct a new ClassBuilder.

Parameters:
configuration - the current configuration of the doclet.
Method Detail

getInstance

public static ClassBuilder getInstance(Configuration configuration,
                                       ClassDoc classDoc,
                                       ClassWriter writer)
                                throws java.lang.Exception
Construct a new ClassBuilder.

Parameters:
configuration - the current configuration of the doclet.
classDoc - the class being documented.
writer - the doclet specific writer.
Throws:
java.lang.Exception

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

build

public void build()
           throws java.io.IOException
Build the documentation.

Specified by:
build in class AbstractBuilder
Throws:
java.io.IOException - there was a problem writing the output.

getName

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

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

buildClassDoc

public void buildClassDoc(java.util.List<?> elements)
                   throws java.lang.Exception
Handles the <ClassDoc> tag.

Parameters:
elements - the XML elements that specify how to document a class.
Throws:
java.lang.Exception

copyDocFiles

private void copyDocFiles()
Copy the doc files for the current ClassDoc if necessary.


buildClassHeader

public void buildClassHeader()
Build the header of the page.


buildClassTree

public void buildClassTree()
Build the class tree documentation.


buildImplementedInterfacesInfo

public void buildImplementedInterfacesInfo()
If this is a class, list all interfaces implemented by this class.


buildSuperInterfacesInfo

public void buildSuperInterfacesInfo()
If this is an interface, list all super interfaces.


buildTypeParamInfo

public void buildTypeParamInfo()
List the parameters of this class.


buildSubClassInfo

public void buildSubClassInfo()
List all the classes extend this one.


buildSubInterfacesInfo

public void buildSubInterfacesInfo()
List all the interfaces that extend this one.


buildInterfaceUsageInfo

public void buildInterfaceUsageInfo()
If this is an interface, list all classes that implement this interface.


buildNestedClassInfo

public void buildNestedClassInfo()
If this is an inner class or interface, list the enclosing class or interface.


buildDeprecationInfo

public void buildDeprecationInfo()
If this class is deprecated, print the appropriate information.


buildClassSignature

public void buildClassSignature()
Build the signature of the current class.


buildClassDescription

public void buildClassDescription()
Build the class description.


buildClassTagInfo

public void buildClassTagInfo()
Build the tag information for the current class.


buildMemberSummary

public void buildMemberSummary(java.util.List<?> elements)
                        throws java.lang.Exception
Build the contents of the page.

Parameters:
elements - the XML elements that specify how a member summary is documented.
Throws:
java.lang.Exception

buildEnumConstantsDetails

public void buildEnumConstantsDetails(java.util.List<?> elements)
                               throws java.lang.Exception
Build the enum constants documentation.

Parameters:
elements - the XML elements that specify how a enum constants are documented.
Throws:
java.lang.Exception

buildFieldDetails

public void buildFieldDetails(java.util.List<?> elements)
                       throws java.lang.Exception
Build the field documentation.

Parameters:
elements - the XML elements that specify how a field is documented.
Throws:
java.lang.Exception

buildConstructorDetails

public void buildConstructorDetails(java.util.List<?> elements)
                             throws java.lang.Exception
Build the constructor documentation.

Parameters:
elements - the XML elements that specify how to document a constructor.
Throws:
java.lang.Exception

buildMethodDetails

public void buildMethodDetails(java.util.List<?> elements)
                        throws java.lang.Exception
Build the method documentation.

Parameters:
elements - the XML elements that specify how a method is documented.
Throws:
java.lang.Exception

buildClassFooter

public void buildClassFooter()
Build the footer of the page.