FileDocCategorySizeDatePackage
AbstractSubWriter.javaAPI DocExample14275Wed Apr 19 11:17:10 BST 2000com.sun.tools.doclets.standard

AbstractSubWriter

public abstract class AbstractSubWriter extends Object
author
Robert Field
author
Atul M Dambalkar

Fields Summary
protected final SubWriterHolderWriter
writer
protected final ClassDoc
classdoc
public VisibleMemberMap
visibleMemberMap
public List
visibleClasses
public boolean
nodepr
Constructors Summary
public AbstractSubWriter(SubWriterHolderWriter writer, ClassDoc classdoc)


         
        this.writer = writer;
        this.classdoc = classdoc;
        buildVisibleMemberMap();
    
public AbstractSubWriter(SubWriterHolderWriter writer)

        this.writer = writer;
        classdoc = null;
    
Methods Summary
protected voidbold(java.lang.String str)

        writer.bold(str);
        writer.displayLength += str.length();
    
public voidbuildVisibleMemberMap()

        visibleMemberMap = new VisibleMemberMap(classdoc, getMemberKind(), 
                                                nodepr);
        visibleClasses = visibleMemberMap.getVisibleClassesList();       
    
public com.sun.javadoc.ProgramElementDoc[]eligibleMembers(com.sun.javadoc.ProgramElementDoc[] members)

        return nodepr? Util.excludeDeprecatedMembers(members): members;
    
public abstract intgetMemberKind()
abstracts

protected java.lang.StringmakeSpace(int len)

        if (len <= 0) {
            return "";
        }
        StringBuffer sb = new StringBuffer(len);
        for(int i = 0; i < len; i++) {
            sb.append(' ");
	}
        return sb.toString();
    
public java.util.Listmembers(com.sun.javadoc.ClassDoc cd)

        return visibleMemberMap.getMembersFor(cd);
    
protected java.lang.StringmodifierString(com.sun.javadoc.MemberDoc member)
Return a string describing the access modifier flags. Don't include native or synchronized. The modifier names are returned in canonical order, as specified by The Java Language Specification.

        int ms = member.modifierSpecifier();
        int no = Modifier.NATIVE | Modifier.SYNCHRONIZED;
	return Modifier.toString(ms & ~no);
    
protected java.lang.Stringname(com.sun.javadoc.ProgramElementDoc member)

        return member.name();
    
protected voidnavDetailLink()

        List members = visibleMemberMap.getMembersFor(classdoc);
        printNavDetailLink(members.size() > 0? true: false);
    
protected voidnavSummaryLink()

        List members = members(classdoc);
        if (members.size() > 0) {
            printNavSummaryLink(null, true);
            return;
        } else {
            ClassDoc icd = classdoc.superclass();
            while (icd != null) {
                List inhmembers = members(icd);
                if (inhmembers.size() > 0) {
                    printNavSummaryLink(icd, true);
                    return;
                }
                icd = icd.superclass();
            }
        }
        printNavSummaryLink(null, false);
    
protected voidprint(java.lang.String str)

        writer.print(str);
        writer.displayLength += str.length();
    
protected voidprint(char ch)

        writer.print(ch);
        writer.displayLength++;
    
protected abstract voidprintBodyHtmlEnd(com.sun.javadoc.ClassDoc cd)

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

        if (member.inlineTags().length > 0) {
            writer.dd();
            writer.printInlineComment(member);
        }
    
protected voidprintCommentAndTags(com.sun.javadoc.ProgramElementDoc member)

        printComment(member);
        printTags(member);
    
protected voidprintDeprecated(com.sun.javadoc.ProgramElementDoc member)

        Tag[] deprs = member.tags("deprecated");
        if (deprs.length > 0) {
	    writer.dd();
            writer.boldText("doclet.Deprecated");
            writer.space();
            writer.printInlineDeprecatedComment(deprs[0]);
            writer.p();
        } else {
            printDeprecatedClassComment(member);
        }
    
protected voidprintDeprecatedAPI(java.util.List deprmembers, java.lang.String headingKey)
Generate the code for listing the deprecated APIs. Create the table format for listing the API. Call methods from the sub-class to complete the generation.

        if (deprmembers.size() > 0) {
            writer.tableIndexSummary();
            writer.tableHeaderStart("#CCCCFF");
            writer.boldText(headingKey);
            writer.tableHeaderEnd();
            for (int i = 0; i < deprmembers.size(); i++) {
                ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i);
                ClassDoc cd = member.containingClass();
                writer.trBgcolorStyle("white", "TableRowColor");
                writer.summaryRow(0);
                printDeprecatedLink(member);
                writer.br();
                writer.printNbsps();
                writer.printInlineDeprecatedComment(member.tags("deprecated")[0]);
                writer.space();
                writer.summaryRowEnd();
                writer.trEnd();
            }
            writer.tableEnd();
            writer.space();
            writer.p();
        }
    
protected voidprintDeprecatedClassComment(com.sun.javadoc.ProgramElementDoc member)

        Tag[] deprs = member.containingClass().tags("deprecated");
        if (deprs.length > 0) {
            writer.dd();
            writer.boldText("doclet.Deprecated");
            writer.space();
        }
    
protected abstract voidprintDeprecatedLink(com.sun.javadoc.ProgramElementDoc member)

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

        writer.dl();
        printDeprecated(member);
        printCommentAndTags(member);
        writer.dlEnd();
    
protected voidprintHead(com.sun.javadoc.MemberDoc member)

        writer.h3();
        writer.print(member.name());
        writer.h3End();
    
protected abstract voidprintHeader(com.sun.javadoc.ClassDoc cd)

public voidprintInheritedMembersSummary()

        for (int i = 0; i < visibleClasses.size(); i++) {
            ClassDoc inhclass = (ClassDoc)(visibleClasses.get(i));
            if (inhclass == classdoc) {
                continue;
            }
            List inhmembers = new ArrayList(members(inhclass));
            if (inhmembers.size() > 0) {
                Collections.sort(inhmembers);
                printInheritedSummaryHeader(inhclass);
                printInheritedSummaryMember(inhclass, 
                                  (ProgramElementDoc)(inhmembers.get(0)));
                for (int j = 1; j < inhmembers.size(); ++j) {
                    print(", "); 
                    printInheritedSummaryMember(inhclass, 
                                    (ProgramElementDoc)(inhmembers.get(j)));
                }
                printInheritedSummaryFooter(inhclass);
            }
        }
    
public abstract voidprintInheritedSummaryAnchor(com.sun.javadoc.ClassDoc cd)

public voidprintInheritedSummaryFooter(com.sun.javadoc.ClassDoc cd)
Forward to containing writer

        writer.printInheritedSummaryFooter(this, cd);
    
public voidprintInheritedSummaryHeader(com.sun.javadoc.ClassDoc cd)
Forward to containing writer

        writer.printInheritedSummaryHeader(this, cd);
    
public abstract voidprintInheritedSummaryLabel(com.sun.javadoc.ClassDoc cd)

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

public voidprintInheritedSummaryMember(com.sun.javadoc.ClassDoc cd, com.sun.javadoc.ProgramElementDoc member)
Forward to containing writer

        writer.printInheritedSummaryMember(this, cd, member);
    
protected abstract voidprintMember(com.sun.javadoc.ProgramElementDoc elem)

public voidprintMembers()

        List members = members(classdoc);
        if (members.size() > 0) {
            printHeader(classdoc);
            for (int i = 0; i < members.size(); ++i) {
                if (i > 0) {
                    writer.printMemberHeader();
                }
                writer.println("");
                printMember((ProgramElementDoc)(members.get(i)));
                writer.printMemberFooter();
            }
            printBodyHtmlEnd(classdoc);
        }
    
public voidprintMembersSummary()

        List members = new ArrayList(members(classdoc));
        if (members.size() > 0) {
            printSummaryHeader(classdoc);
            Collections.sort(members);
            for (int i = 0; i < members.size(); ++i) {
                printSummaryMember(classdoc, 
                                   (ProgramElementDoc)(members.get(i)));
            }   
            printSummaryFooter(classdoc);
        }
    
protected voidprintModifier(com.sun.javadoc.ProgramElementDoc member)

        if (member.isProtected()) {
            print("protected ");
        } else if (member.isPrivate()) {
            print("private ");
        } else if (!member.isPublic()) { // Package private
            writer.printText("doclet.Package_private");
            print(" ");
        }
        if (member.isMethod() && ((MethodDoc)member).isAbstract()) {
            print("abstract ");
        }
        if (member.isStatic()) {
            print("static");
        }
        writer.space();
    
protected voidprintModifierAndType(com.sun.javadoc.ProgramElementDoc member, com.sun.javadoc.Type type)

        writer.printTypeSummaryHeader();
        printModifier(member);
        if (type == null) {
	    if (member.isClass()) {
                print("class");
            } else {
	        print("interface");
            }
        } else {
            printTypeLink(type); 
        }
        writer.printTypeSummaryFooter();
    
protected voidprintModifiers(com.sun.javadoc.MemberDoc member)

        String mod;
        mod = modifierString(member);
        if(mod.length() > 0) {
            print(mod);
            print(' ");
        }
    
protected abstract voidprintNavDetailLink(boolean link)

protected abstract voidprintNavSummaryLink(com.sun.javadoc.ClassDoc cd, boolean link)

protected voidprintStaticAndType(boolean isStatic, com.sun.javadoc.Type type)
Print 'static' if static and type link.

        writer.printTypeSummaryHeader();
        if (isStatic) {
            print("static"); 
        }
        writer.space();
        if (type != null) {
            printTypeLink(type); 
        }
        writer.printTypeSummaryFooter();
    
public abstract voidprintSummaryAnchor(com.sun.javadoc.ClassDoc cd)

public voidprintSummaryFooter(com.sun.javadoc.ClassDoc cd)
Forward to containing writer

        writer.printSummaryFooter(this, cd);
    
public voidprintSummaryHeader(com.sun.javadoc.ClassDoc cd)
Forward to containing writer

        writer.printSummaryHeader(this, cd);
    
public abstract voidprintSummaryLabel(com.sun.javadoc.ClassDoc cd)

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

public voidprintSummaryMember(com.sun.javadoc.ClassDoc cd, com.sun.javadoc.ProgramElementDoc member)
Forward to containing writer

        writer.printSummaryMember(this, cd, member);
    
protected abstract voidprintSummaryType(com.sun.javadoc.ProgramElementDoc member)

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

        Tag[] since = member.tags("since");
        if (member.seeTags().length + since.length > 0) {
            writer.dd();
            writer.dl();
            writer.printSeeTags(member);
            writer.printSinceTag(member);
            writer.dlEnd();
            writer.ddEnd();
        }
    
protected voidprintTypeLink(com.sun.javadoc.Type type)

        printTypeLinkNoDimension(type);
        print(type.dimension());
    
protected voidprintTypeLinkNoDimension(com.sun.javadoc.Type type)

        ClassDoc cd = type.asClassDoc();
	if (cd == null) {
	    print(type.typeName()); 
	} else {
	    writer.printClassLink(cd);
	}
    
protected voidprintTypedName(com.sun.javadoc.Type type, java.lang.String name)

        if (type != null) {
            printTypeLink(type);
        }
        if(name.length() > 0) {
            writer.space();
            writer.print(name);
        }
    
protected voidprintUseInfo(java.lang.Object mems, java.lang.String heading)
Print use info.

        if (mems == null) {
            return;
        }
        List members = (List)mems;
        if (members.size() > 0) {
            writer.tableIndexSummary();
            writer.tableUseInfoHeaderStart("#CCCCFF");
            writer.print(heading);
            writer.tableHeaderEnd();
            for (Iterator it = members.iterator(); it.hasNext(); ) {
                ProgramElementDoc pgmdoc = (ProgramElementDoc)it.next();
                ClassDoc cd = pgmdoc.containingClass();

                writer.printSummaryLinkType(this, pgmdoc);
                if (cd != null && !(pgmdoc instanceof ConstructorDoc) 
                               && !(pgmdoc instanceof ClassDoc)) {
                    // Add class context
                    writer.bold(cd.name() + ".");
                }
                printSummaryLink(cd, pgmdoc);
                writer.printSummaryLinkComment(this, pgmdoc);     
            }
            writer.tableEnd();
            writer.space();
            writer.p();
        }
    
protected voidserialWarning(java.lang.String key, java.lang.String a1, java.lang.String a2)

        if (Standard.configuration().serialwarn) {
            Standard.configuration().standardmessage.warning(key, a1, a2);
        }
    
protected java.lang.StringtypeString(com.sun.javadoc.MemberDoc member)

        String type = "";
        if (member instanceof MethodDoc) {
            type = ((MethodDoc)member).returnType().toString();
        } else if (member instanceof FieldDoc) {
            type = ((FieldDoc)member).type().toString();
        }
        return type;