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

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

public class SerializedFormBuilder
extends AbstractBuilder

Builds the serialized form. 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 currentClass
          The current class being documented.
protected  MemberDoc currentMember
          The current member being documented.
private  PackageDoc currentPackage
          The current package being documented.
private  SerializedFormWriter.SerialFieldWriter fieldWriter
          The writer for serializable fields.
private  SerializedFormWriter.SerialMethodWriter methodWriter
          The writer for serializable method documentation.
static java.lang.String NAME
          The root element of the serialized form XML is "SerializedForm".
private static java.lang.String SERIAL_VERSION_UID_HEADER
          The header for the serial version UID.
private  SerializedFormWriter writer
          The writer for this builder.
 
Fields inherited from class com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder
configuration, containingPackagesSeen, DEBUG
 
Constructor Summary
private SerializedFormBuilder(Configuration configuration)
           
 
Method Summary
 void build()
          Build the serialized form.
 void buildClassHeader()
           
 void buildClassSerializedForm(java.util.List<?> elements)
           
 void buildDeprecatedMethodInfo()
          Build the deprecated method description.
 void buildFieldFooter()
          Build the field footer.
 void buildFieldHeader()
          Build the field header.
 void buildFieldInfo()
          Build the field information.
 void buildFieldSerializationOverview(ClassDoc classDoc)
          If possible, build the serialization overview for the given class.
 void buildFieldSubHeader()
          Build the field sub header.
 void buildFooter()
          Build the footer.
 void buildHeader()
          Build the header.
 void buildMethodDescription()
          Build method tags.
 void buildMethodFooter()
          Build the method footer.
 void buildMethodHeader()
          Build the method header.
 void buildMethodInfo(java.util.List<?> elements)
          build the information for the method.
 void buildMethodSubHeader()
          Build the method sub header.
 void buildMethodTags()
          Build the method tags.
 void buildPackageHeader()
           
 void buildPackageSerializedForm(java.util.List<?> elements)
          Build the package serialized for for the current package being processed.
 void buildSerializableFields(java.util.List<?> elements)
          Build the summaries for the fields that belong to the given class.
 void buildSerializableMethods(java.util.List<?> elements)
          Build the summaries for the methods that belong to the given class.
 void buildSerializedForm(java.util.List<?> elements)
          Build the serialized form.
 void buildSerializedFormSummaries(java.util.List<?> elements)
          Build the contents.
 void buildSerialUIDInfo()
          Build the serial UID information for the given class.
static SerializedFormBuilder getInstance(Configuration configuration)
          Construct a new SerializedFormBuilder.
 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.
private  boolean serialClassFoundToDocument(ClassDoc[] classes)
          Return true if any of the given classes have a @serialinclude tag.
private static boolean serialClassInclude(ClassDoc cd)
          Return true if the given ClassDoc should be included in the serialized form.
private static boolean serialDocInclude(Doc doc)
          Return true if the given Doc should be included in the serialized form.
static boolean serialInclude(Doc doc)
          Return true if the given Doc should be included in the serialized form.
 
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

NAME

public static final java.lang.String NAME
The root element of the serialized form XML is "SerializedForm".

See Also:
Constant Field Values

writer

private SerializedFormWriter writer
The writer for this builder.


fieldWriter

private SerializedFormWriter.SerialFieldWriter fieldWriter
The writer for serializable fields.


methodWriter

private SerializedFormWriter.SerialMethodWriter methodWriter
The writer for serializable method documentation.


SERIAL_VERSION_UID_HEADER

private static final java.lang.String SERIAL_VERSION_UID_HEADER
The header for the serial version UID. Save the string here instead of the properties file because we do not want this string to be localized.

See Also:
Constant Field Values

currentPackage

private PackageDoc currentPackage
The current package being documented.


currentClass

private ClassDoc currentClass
The current class being documented.


currentMember

protected MemberDoc currentMember
The current member being documented.

Constructor Detail

SerializedFormBuilder

private SerializedFormBuilder(Configuration configuration)
Method Detail

getInstance

public static SerializedFormBuilder getInstance(Configuration configuration)
Construct a new SerializedFormBuilder.

Parameters:
configuration - the current configuration of the doclet.

build

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

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.

buildSerializedForm

public void buildSerializedForm(java.util.List<?> elements)
                         throws java.lang.Exception
Build the serialized form.

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

buildHeader

public void buildHeader()
Build the header.


buildSerializedFormSummaries

public void buildSerializedFormSummaries(java.util.List<?> elements)
Build the contents.


buildPackageSerializedForm

public void buildPackageSerializedForm(java.util.List<?> elements)
Build the package serialized for for the current package being processed.


buildPackageHeader

public void buildPackageHeader()

buildClassSerializedForm

public void buildClassSerializedForm(java.util.List<?> elements)

buildClassHeader

public void buildClassHeader()

buildSerialUIDInfo

public void buildSerialUIDInfo()
Build the serial UID information for the given class.


buildFooter

public void buildFooter()
Build the footer.


serialInclude

public static boolean serialInclude(Doc doc)
Return true if the given Doc should be included in the serialized form.

Parameters:
doc - the Doc object to check for serializability.

serialClassInclude

private static boolean serialClassInclude(ClassDoc cd)
Return true if the given ClassDoc should be included in the serialized form.

Parameters:
cd - the ClassDoc object to check for serializability.

serialDocInclude

private static boolean serialDocInclude(Doc doc)
Return true if the given Doc should be included in the serialized form.

Parameters:
doc - the Doc object to check for serializability.

serialClassFoundToDocument

private boolean serialClassFoundToDocument(ClassDoc[] classes)
Return true if any of the given classes have a @serialinclude tag.

Parameters:
classes - the classes to check.
Returns:
true if any of the given classes have a @serialinclude tag.

buildMethodHeader

public void buildMethodHeader()
Build the method header.


buildMethodSubHeader

public void buildMethodSubHeader()
Build the method sub header.


buildDeprecatedMethodInfo

public void buildDeprecatedMethodInfo()
Build the deprecated method description.


buildMethodDescription

public void buildMethodDescription()
Build method tags.


buildMethodTags

public void buildMethodTags()
Build the method tags.


buildMethodInfo

public void buildMethodInfo(java.util.List<?> elements)
build the information for the method.


buildMethodFooter

public void buildMethodFooter()
Build the method footer.


buildFieldHeader

public void buildFieldHeader()
Build the field header.


buildFieldSerializationOverview

public void buildFieldSerializationOverview(ClassDoc classDoc)
If possible, build the serialization overview for the given class.

Parameters:
classDoc - the class to print the overview for.

buildFieldSubHeader

public void buildFieldSubHeader()
Build the field sub header.


buildFieldInfo

public void buildFieldInfo()
Build the field information.


buildFieldFooter

public void buildFieldFooter()
Build the field footer.


buildSerializableMethods

public void buildSerializableMethods(java.util.List<?> elements)
Build the summaries for the methods that belong to the given class.


buildSerializableFields

public void buildSerializableFields(java.util.List<?> elements)
Build the summaries for the fields that belong to the given class.