FileDocCategorySizeDatePackage
SerializedFormWriter.javaAPI DocExample4699Wed Apr 19 11:17:14 BST 2000com.sun.tools.doclets.standard

SerializedFormWriter

public class SerializedFormWriter extends SubWriterHolderWriter
Generate the Serialized Form Information Page.
author
Atul M Dambalkar

Fields Summary
Constructors Summary
public SerializedFormWriter(String filename)

        super(filename);
    
Methods Summary
public static voidgenerate(com.sun.javadoc.RootDoc root)
Generate a serialized form page.

            SerializedFormWriter serialgen;
            String filename = "serialized-form.html";
            try {
                serialgen = new SerializedFormWriter(filename);
                serialgen.generateSerializedFormFile(root);
                serialgen.close();
            } catch (IOException exc) {
                Standard.configuration().standardmessage.
                    error("doclet.exception_encountered",
                           exc.toString(), filename);
                throw new DocletAbortException();
            }
    
protected voidgenerateContents(com.sun.javadoc.RootDoc root)
Generate the serialized form file contents.

        PackageDoc[] packages = Standard.configuration().packages;
        ClassDoc[] cmdlineClasses = root.specifiedClasses();
        boolean first = true;
        for (int i = 0; i < packages.length; i++) {
            ClassDoc[] classes = packages[i].allClasses();
            boolean printPackageName = true;
            Arrays.sort(classes);
            for (int j = 0; j < classes.length; j++) {
                ClassDoc classdoc = classes[j];
                if(classdoc.isClass() && classdoc.isSerializable()) {
                    if (printPackageName) {
                        hr(4, "noshade");
                        printPackageName(packages[i].name());
                        printPackageName = false;
                    }
                    first = false;
                    printSerialMemberInfo(classdoc);
                }
            }
        }
        if (cmdlineClasses.length > 0) {
            Arrays.sort(cmdlineClasses);
            for (int i = 0; i < cmdlineClasses.length; i++) {
                ClassDoc classdoc = cmdlineClasses[i];
                if(classdoc.isClass() && classdoc.isSerializable()) {
                    if (!first) {
                        hr(4, "noshade");
                    }
                    first = false;
                    printSerialMemberInfo(classdoc);
                }
            }
        }
    
public voidgenerateSerializedFormFile(com.sun.javadoc.RootDoc root)
Generate the serialized form file.

        printHeader(getText("doclet.Serialized_Form"));
        navLinks(true);
        hr();

        center();
        h1(); printText("doclet.Serialized_Form"); h1End();
        centerEnd();

        generateContents(root);

        hr();
        navLinks(false);
        printBottom();
        printBodyHtmlEnd();
    
protected voidprintClassName(java.lang.String classstr)

        tableHeader();
        tdColspan(2);
        font("+2");
        bold(classstr);
        tableFooter();
    
protected voidprintPackageName(java.lang.String pkgname)
Print the package name in the table format.

        tableHeader();
        tdAlign("center");
        font("+2");
        boldText("doclet.Package");
        print(' ");
        bold(pkgname);
        tableFooter();
    
protected voidprintSerialMemberInfo(com.sun.javadoc.ClassDoc cd)
Print all the serializable member information.

        String classlink = getQualifiedClassLink(cd);
        anchor(cd.qualifiedName());
        printClassName(getText("doclet.Class_0_implements_serializable", 
                                classlink));

	printSerialMembers(cd);
        p();
    
protected voidprintSerialMembers(com.sun.javadoc.ClassDoc cd)
Print summary and detail information for the serial members in the class.

	new SerialMethodSubWriter(this, cd).printMembers();
	new SerialFieldSubWriter(this, cd).printMembers();
    
protected voidtableFooter()

        fontEnd();
        tdEnd(); trEnd(); tableEnd();
        p(); 
    
protected voidtableHeader()

        tableIndexSummary();
        trBgcolorStyle("#CCCCFF", "TableSubHeadingColor");