FileDocCategorySizeDatePackage
SerialFieldSubWriter.javaAPI DocExample4886Wed Apr 19 11:17:12 BST 2000com.sun.tools.doclets.standard

SerialFieldSubWriter

public class SerialFieldSubWriter extends FieldSubWriter
Generate serialized form for serializable fields. Documentation denoted by the tags serial and serialField<\code> is processed.
author
Joe Fialli

Fields Summary
ProgramElementDoc[]
members
Constructors Summary
public SerialFieldSubWriter(SubWriterHolderWriter writer, ClassDoc classdoc)


       
                                  
        super(writer, classdoc);
    
Methods Summary
public voidbuildVisibleMemberMap()

      // Do nothing.
    
public java.util.Listmembers(com.sun.javadoc.ClassDoc cd)

	return Util.asList(cd.serializableFields());
    
protected voidprintBodyHtmlEnd(com.sun.javadoc.ClassDoc cd)

    
private voidprintComment(com.sun.javadoc.SerialFieldTag sftag)

	writer.dl();
        writer.dd();
        writer.printInlineComment(sftag);
	writer.dlEnd();
    
protected voidprintComment(com.sun.javadoc.ProgramElementDoc member)

        if (member.inlineTags().length > 0) {
            writer.dd();
            writer.printInlineComment(member);
        } 

	Tag[] tags = member.tags("serial");
	if (tags.length > 0) {
            writer.dt();
            writer.dd();
	    writer.printInlineComment(tags[0]);
	}
    
protected voidprintDeprecatedLink(com.sun.javadoc.ProgramElementDoc member)

    
protected voidprintHeader(com.sun.javadoc.ClassDoc cd)

        writer.anchor("serializedForm");
	printSerializableClassComment(cd);
	writer.printTableHeadingBackground(writer.getText("doclet.Serialized_Form_fields"));
    
public voidprintInheritedSummaryLabel(com.sun.javadoc.ClassDoc cd)

    
protected voidprintInheritedSummaryLink(com.sun.javadoc.ClassDoc cd, com.sun.javadoc.ProgramElementDoc member)

    
protected voidprintMember(com.sun.javadoc.ProgramElementDoc member)
Print a default Serializable field or print all Serializable fields documented by serialField tags.

        FieldDoc field = (FieldDoc)member;
	ClassDoc cd = field.containingClass();
	if (cd.definesSerializableFields()) {

	    // Process Serializable Fields specified as array of ObjectStreamFields.
	    //Print a member for each serialField tag.
	    //(There should be one serialField tag per ObjectStreamField element.)
	    SerialFieldTag[] tags = field.serialFieldTags();
	    Arrays.sort(tags);
	    for (int i = 0; i < tags.length; i++) {
		if (i > 0) {
		    writer.printMemberHeader();
		} 
		printSignature(tags[i]);
		printComment(tags[i]);
                writer.printMemberFooter();
	    }
	} else {

	    // Process default Serializable field.
	    if ((field.tags("serial").length == 0) && ! field.isSynthetic()) {
                serialWarning("doclet.MissingSerialTag", cd.qualifiedName(), 
                               field.name());
	    }
	    printSignature(field);
	    printFullComment(field);
	}
    
private voidprintSerializableClassComment(com.sun.javadoc.ClassDoc cd)
javadoc comments for "serialPersistentFields" is considered as serializable class comments, not field comments.

	if (cd.definesSerializableFields()) {
	    FieldDoc serialPersistentFields = 
                                        (FieldDoc)(members(classdoc).get(0));
	    String comment = serialPersistentFields.commentText();
	    if (comment.length() > 0) {
		writer.printTableHeadingBackground(writer.getText("doclet.Serialized_Form_class"));
		printFullComment(serialPersistentFields);
	    }
	}
    
voidprintSignature(com.sun.javadoc.MemberDoc member)

        FieldDoc field = (FieldDoc)member;
        printHead(member);
	writer.pre();
        printTypeLink(field.type());
        print(' ");
        bold(field.name());
	writer.preEnd();
    
voidprintSignature(com.sun.javadoc.SerialFieldTag sftag)

	writer.pre();
	ClassDoc fieldTypeDoc = sftag.fieldTypeDoc();
	if (fieldTypeDoc != null) {
	    writer.printClassLink(fieldTypeDoc);
        } else {
	    writer.print(sftag.fieldType());
	}
        print(' ");
        bold(sftag.fieldName());
	writer.preEnd();
    
public voidprintSummaryLabel(com.sun.javadoc.ClassDoc cd)

    
protected voidprintSummaryLink(com.sun.javadoc.ClassDoc cd, com.sun.javadoc.ProgramElementDoc member)

    
protected voidprintSummaryType(com.sun.javadoc.ProgramElementDoc member)