src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java

Sat, 13 Apr 2013 18:48:29 -0700

author
bpatel
date
Sat, 13 Apr 2013 18:48:29 -0700
changeset 1691
f10cffab99b4
parent 1476
0e17c3c23e3b
child 1735
8ea30d59ac41
permissions
-rw-r--r--

8009686: Generated javadoc documentation should be able to display type annotation on an array
Reviewed-by: jjg

     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.tools.doclets.formats.html;
    28 import java.lang.reflect.Modifier;
    29 import java.util.*;
    31 import com.sun.javadoc.*;
    32 import com.sun.tools.doclets.formats.html.markup.*;
    33 import com.sun.tools.doclets.internal.toolkit.*;
    34 import com.sun.tools.doclets.internal.toolkit.taglets.*;
    35 import com.sun.tools.doclets.internal.toolkit.util.*;
    37 /**
    38  * The base class for member writers.
    39  *
    40  *  <p><b>This is NOT part of any supported API.
    41  *  If you write code that depends on this, you do so at your own risk.
    42  *  This code and its internal interfaces are subject to change or
    43  *  deletion without notice.</b>
    44  *
    45  * @author Robert Field
    46  * @author Atul M Dambalkar
    47  * @author Jamie Ho (Re-write)
    48  * @author Bhavesh Patel (Modified)
    49  */
    50 public abstract class AbstractMemberWriter {
    52     protected final ConfigurationImpl configuration;
    53     protected final SubWriterHolderWriter writer;
    54     protected final ClassDoc classdoc;
    55     protected Map<String,Integer> typeMap = new LinkedHashMap<String,Integer>();
    56     protected Set<MethodTypes> methodTypes = EnumSet.noneOf(MethodTypes.class);
    57     private int methodTypesOr = 0;
    58     public final boolean nodepr;
    60     protected boolean printedSummaryHeader = false;
    62     public AbstractMemberWriter(SubWriterHolderWriter writer, ClassDoc classdoc) {
    63         this.configuration = writer.configuration;
    64         this.writer = writer;
    65         this.nodepr = configuration.nodeprecated;
    66         this.classdoc = classdoc;
    67     }
    69     public AbstractMemberWriter(SubWriterHolderWriter writer) {
    70         this(writer, null);
    71     }
    73     /*** abstracts ***/
    75     /**
    76      * Add the summary label for the member.
    77      *
    78      * @param memberTree the content tree to which the label will be added
    79      */
    80     public abstract void addSummaryLabel(Content memberTree);
    82     /**
    83      * Get the summary for the member summary table.
    84      *
    85      * @return a string for the table summary
    86      */
    87     public abstract String getTableSummary();
    89     /**
    90      * Get the caption for the member summary table.
    91      *
    92      * @return a string for the table caption
    93      */
    94     public abstract String getCaption();
    96     /**
    97      * Get the summary table header for the member.
    98      *
    99      * @param member the member to be documented
   100      * @return the summary table header
   101      */
   102     public abstract String[] getSummaryTableHeader(ProgramElementDoc member);
   104     /**
   105      * Add inherited summary lable for the member.
   106      *
   107      * @param cd the class doc to which to link to
   108      * @param inheritedTree the content tree to which the inherited summary label will be added
   109      */
   110     public abstract void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree);
   112     /**
   113      * Add the anchor for the summary section of the member.
   114      *
   115      * @param cd the class doc to be documented
   116      * @param memberTree the content tree to which the summary anchor will be added
   117      */
   118     public abstract void addSummaryAnchor(ClassDoc cd, Content memberTree);
   120     /**
   121      * Add the anchor for the inherited summary section of the member.
   122      *
   123      * @param cd the class doc to be documented
   124      * @param inheritedTree the content tree to which the inherited summary anchor will be added
   125      */
   126     public abstract void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree);
   128     /**
   129      * Add the summary type for the member.
   130      *
   131      * @param member the member to be documented
   132      * @param tdSummaryType the content tree to which the type will be added
   133      */
   134     protected abstract void addSummaryType(ProgramElementDoc member,
   135             Content tdSummaryType);
   137     /**
   138      * Add the summary link for the member.
   139      *
   140      * @param cd the class doc to be documented
   141      * @param member the member to be documented
   142      * @param tdSummary the content tree to which the link will be added
   143      */
   144     protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member,
   145             Content tdSummary) {
   146         addSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member, tdSummary);
   147     }
   149     /**
   150      * Add the summary link for the member.
   151      *
   152      * @param context the id of the context where the link will be printed
   153      * @param cd the class doc to be documented
   154      * @param member the member to be documented
   155      * @param tdSummary the content tree to which the summary link will be added
   156      */
   157     protected abstract void addSummaryLink(int context,
   158             ClassDoc cd, ProgramElementDoc member, Content tdSummary);
   160     /**
   161      * Add the inherited summary link for the member.
   162      *
   163      * @param cd the class doc to be documented
   164      * @param member the member to be documented
   165      * @param linksTree the content tree to which the inherited summary link will be added
   166      */
   167     protected abstract void addInheritedSummaryLink(ClassDoc cd,
   168             ProgramElementDoc member, Content linksTree);
   170     /**
   171      * Get the deprecated link.
   172      *
   173      * @param member the member being linked to
   174      * @return a content tree representing the link
   175      */
   176     protected abstract Content getDeprecatedLink(ProgramElementDoc member);
   178     /**
   179      * Get the navigation summary link.
   180      *
   181      * @param cd the class doc to be documented
   182      * @param link true if its a link else the label to be printed
   183      * @return a content tree for the navigation summary link.
   184      */
   185     protected abstract Content getNavSummaryLink(ClassDoc cd, boolean link);
   187     /**
   188      * Add the navigation detail link.
   189      *
   190      * @param link true if its a link else the label to be printed
   191      * @param liNav the content tree to which the navigation detail link will be added
   192      */
   193     protected abstract void addNavDetailLink(boolean link, Content liNav);
   195     /**
   196      * Add the member name to the content tree and modifies the display length.
   197      *
   198      * @param name the member name to be added to the content tree.
   199      * @param htmltree the content tree to which the name will be added.
   200      */
   201     protected void addName(String name, Content htmltree) {
   202         htmltree.addContent(name);
   203         writer.displayLength += name.length();
   204     }
   206     /**
   207      * Return a string describing the access modifier flags.
   208      * Don't include native or synchronized.
   209      *
   210      * The modifier names are returned in canonical order, as
   211      * specified by <em>The Java Language Specification</em>.
   212      */
   213     protected String modifierString(MemberDoc member) {
   214         int ms = member.modifierSpecifier();
   215         int no = Modifier.NATIVE | Modifier.SYNCHRONIZED;
   216     return Modifier.toString(ms & ~no);
   217     }
   219     protected String typeString(MemberDoc member) {
   220         String type = "";
   221         if (member instanceof MethodDoc) {
   222             type = ((MethodDoc)member).returnType().toString();
   223         } else if (member instanceof FieldDoc) {
   224             type = ((FieldDoc)member).type().toString();
   225         }
   226         return type;
   227     }
   229     /**
   230      * Add the modifier for the member.
   231      *
   232      * @param member the member for which teh modifier will be added.
   233      * @param htmltree the content tree to which the modifier information will be added.
   234      */
   235     protected void addModifiers(MemberDoc member, Content htmltree) {
   236         String mod = modifierString(member);
   237         // According to JLS, we should not be showing public modifier for
   238         // interface methods.
   239         if ((member.isField() || member.isMethod()) &&
   240             writer instanceof ClassWriterImpl &&
   241             ((ClassWriterImpl) writer).getClassDoc().isInterface()) {
   242             // This check for isDefault() and the default modifier needs to be
   243             // added for it to appear on the method details section. Once the
   244             // default modifier is added to the Modifier list on DocEnv and once
   245             // it is updated to use the javax.lang.model.element.Modifier, we
   246             // will need to remove this.
   247             mod = (member.isMethod() && ((MethodDoc)member).isDefault()) ?
   248                     Util.replaceText(mod, "public", "default").trim() :
   249                     Util.replaceText(mod, "public", "").trim();
   250         }
   251         if(mod.length() > 0) {
   252             htmltree.addContent(mod);
   253             htmltree.addContent(writer.getSpace());
   254         }
   255     }
   257     protected String makeSpace(int len) {
   258         if (len <= 0) {
   259             return "";
   260         }
   261         StringBuilder sb = new StringBuilder(len);
   262         for(int i = 0; i < len; i++) {
   263             sb.append(' ');
   264     }
   265         return sb.toString();
   266     }
   268     /**
   269      * Add the modifier and type for the member in the member summary.
   270      *
   271      * @param member the member to add the type for
   272      * @param type the type to add
   273      * @param tdSummaryType the content tree to which the modified and type will be added
   274      */
   275     protected void addModifierAndType(ProgramElementDoc member, Type type,
   276             Content tdSummaryType) {
   277         HtmlTree code = new HtmlTree(HtmlTag.CODE);
   278         addModifier(member, code);
   279         if (type == null) {
   280             if (member.isClass()) {
   281                 code.addContent("class");
   282             } else {
   283                 code.addContent("interface");
   284             }
   285             code.addContent(writer.getSpace());
   286         } else {
   287             if (member instanceof ExecutableMemberDoc &&
   288                     ((ExecutableMemberDoc) member).typeParameters().length > 0) {
   289                 //Code to avoid ugly wrapping in member summary table.
   290                 int displayLength = ((AbstractExecutableMemberWriter) this).addTypeParameters(
   291                         (ExecutableMemberDoc) member, code);
   292                 if (displayLength > 10) {
   293                     code.addContent(new HtmlTree(HtmlTag.BR));
   294                 }
   295                 code.addContent(new RawHtml(
   296                         writer.getLink(new LinkInfoImpl(configuration,
   297                         LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
   298             } else {
   299                 code.addContent(new RawHtml(
   300                         writer.getLink(new LinkInfoImpl(configuration,
   301                         LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
   302             }
   304         }
   305         tdSummaryType.addContent(code);
   306     }
   308     /**
   309      * Add the modifier for the member.
   310      *
   311      * @param member the member to add the type for
   312      * @param code the content tree to which the modified will be added
   313      */
   314     private void addModifier(ProgramElementDoc member, Content code) {
   315         if (member.isProtected()) {
   316             code.addContent("protected ");
   317         } else if (member.isPrivate()) {
   318             code.addContent("private ");
   319         } else if (!member.isPublic()) { // Package private
   320             code.addContent(configuration.getText("doclet.Package_private"));
   321             code.addContent(" ");
   322         }
   323         if (member.isMethod()) {
   324             if (!(member.containingClass().isInterface()) &&
   325                     ((MethodDoc)member).isAbstract()) {
   326                 code.addContent("abstract ");
   327             }
   328             // This check for isDefault() and the default modifier needs to be
   329             // added for it to appear on the "Modifier and Type" column in the
   330             // method summary section. Once the default modifier is added
   331             // to the Modifier list on DocEnv and once it is updated to use the
   332             // javax.lang.model.element.Modifier, we will need to remove this.
   333             if (((MethodDoc)member).isDefault()) {
   334                 code.addContent("default ");
   335             }
   336         }
   337         if (member.isStatic()) {
   338             code.addContent("static ");
   339         }
   340     }
   342     /**
   343      * Add the deprecated information for the given member.
   344      *
   345      * @param member the member being documented.
   346      * @param contentTree the content tree to which the deprecated information will be added.
   347      */
   348     protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) {
   349         String output = (new DeprecatedTaglet()).getTagletOutput(member,
   350             writer.getTagletWriterInstance(false)).toString().trim();
   351         if (!output.isEmpty()) {
   352             Content deprecatedContent = new RawHtml(output);
   353             Content div = HtmlTree.DIV(HtmlStyle.block, deprecatedContent);
   354             contentTree.addContent(div);
   355         }
   356     }
   358     /**
   359      * Add the comment for the given member.
   360      *
   361      * @param member the member being documented.
   362      * @param htmltree the content tree to which the comment will be added.
   363      */
   364     protected void addComment(ProgramElementDoc member, Content htmltree) {
   365         if (member.inlineTags().length > 0) {
   366             writer.addInlineComment(member, htmltree);
   367         }
   368     }
   370     protected String name(ProgramElementDoc member) {
   371         return member.name();
   372     }
   374     /**
   375      * Get the header for the section.
   376      *
   377      * @param member the member being documented.
   378      * @return a header content for the section.
   379      */
   380     protected Content getHead(MemberDoc member) {
   381         Content memberContent = new RawHtml(member.name());
   382         Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent);
   383         return heading;
   384     }
   386     /**
   387     * Return true if the given <code>ProgramElement</code> is inherited
   388     * by the class that is being documented.
   389     *
   390     * @param ped The <code>ProgramElement</code> being checked.
   391     * return true if the <code>ProgramElement</code> is being inherited and
   392     * false otherwise.
   393     */
   394     protected boolean isInherited(ProgramElementDoc ped){
   395         if(ped.isPrivate() || (ped.isPackagePrivate() &&
   396             ! ped.containingPackage().equals(classdoc.containingPackage()))){
   397             return false;
   398         }
   399         return true;
   400     }
   402     /**
   403      * Add deprecated information to the documentation tree
   404      *
   405      * @param deprmembers list of deprecated members
   406      * @param headingKey the caption for the deprecated members table
   407      * @param tableSummary the summary for the deprecated members table
   408      * @param tableHeader table headers for the deprecated members table
   409      * @param contentTree the content tree to which the deprecated members table will be added
   410      */
   411     protected void addDeprecatedAPI(List<Doc> deprmembers, String headingKey,
   412             String tableSummary, String[] tableHeader, Content contentTree) {
   413         if (deprmembers.size() > 0) {
   414             Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
   415                 writer.getTableCaption(configuration.getText(headingKey)));
   416             table.addContent(writer.getSummaryTableHeader(tableHeader, "col"));
   417             Content tbody = new HtmlTree(HtmlTag.TBODY);
   418             for (int i = 0; i < deprmembers.size(); i++) {
   419                 ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i);
   420                 HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, getDeprecatedLink(member));
   421                 if (member.tags("deprecated").length > 0)
   422                     writer.addInlineDeprecatedComment(member,
   423                             member.tags("deprecated")[0], td);
   424                 HtmlTree tr = HtmlTree.TR(td);
   425                 if (i%2 == 0)
   426                     tr.addStyle(HtmlStyle.altColor);
   427                 else
   428                     tr.addStyle(HtmlStyle.rowColor);
   429                 tbody.addContent(tr);
   430             }
   431             table.addContent(tbody);
   432             Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   433             Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
   434             contentTree.addContent(ul);
   435         }
   436     }
   438     /**
   439      * Add use information to the documentation tree.
   440      *
   441      * @param mems list of program elements for which the use information will be added
   442      * @param heading the section heading
   443      * @param tableSummary the summary for the use table
   444      * @param contentTree the content tree to which the use information will be added
   445      */
   446     protected void addUseInfo(List<? extends ProgramElementDoc> mems,
   447             String heading, String tableSummary, Content contentTree) {
   448         if (mems == null) {
   449             return;
   450         }
   451         List<? extends ProgramElementDoc> members = mems;
   452         boolean printedUseTableHeader = false;
   453         if (members.size() > 0) {
   454             Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
   455                     writer.getTableCaption(heading));
   456             Content tbody = new HtmlTree(HtmlTag.TBODY);
   457             Iterator<? extends ProgramElementDoc> it = members.iterator();
   458             for (int i = 0; it.hasNext(); i++) {
   459                 ProgramElementDoc pgmdoc = it.next();
   460                 ClassDoc cd = pgmdoc.containingClass();
   461                 if (!printedUseTableHeader) {
   462                     table.addContent(writer.getSummaryTableHeader(
   463                             this.getSummaryTableHeader(pgmdoc), "col"));
   464                     printedUseTableHeader = true;
   465                 }
   466                 HtmlTree tr = new HtmlTree(HtmlTag.TR);
   467                 if (i % 2 == 0) {
   468                     tr.addStyle(HtmlStyle.altColor);
   469                 } else {
   470                     tr.addStyle(HtmlStyle.rowColor);
   471                 }
   472                 HtmlTree tdFirst = new HtmlTree(HtmlTag.TD);
   473                 tdFirst.addStyle(HtmlStyle.colFirst);
   474                 writer.addSummaryType(this, pgmdoc, tdFirst);
   475                 tr.addContent(tdFirst);
   476                 HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
   477                 tdLast.addStyle(HtmlStyle.colLast);
   478                 if (cd != null && !(pgmdoc instanceof ConstructorDoc)
   479                         && !(pgmdoc instanceof ClassDoc)) {
   480                     HtmlTree name = new HtmlTree(HtmlTag.SPAN);
   481                     name.addStyle(HtmlStyle.strong);
   482                     name.addContent(cd.name() + ".");
   483                     tdLast.addContent(name);
   484                 }
   485                 addSummaryLink(pgmdoc instanceof ClassDoc ?
   486                     LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER,
   487                     cd, pgmdoc, tdLast);
   488                 writer.addSummaryLinkComment(this, pgmdoc, tdLast);
   489                 tr.addContent(tdLast);
   490                 tbody.addContent(tr);
   491             }
   492             table.addContent(tbody);
   493             contentTree.addContent(table);
   494         }
   495     }
   497     /**
   498      * Add the navigation detail link.
   499      *
   500      * @param members the members to be linked
   501      * @param liNav the content tree to which the navigation detail link will be added
   502      */
   503     protected void addNavDetailLink(List<?> members, Content liNav) {
   504         addNavDetailLink(members.size() > 0 ? true : false, liNav);
   505     }
   507     /**
   508      * Add the navigation summary link.
   509      *
   510      * @param members members to be linked
   511      * @param visibleMemberMap the visible inherited members map
   512      * @param liNav the content tree to which the navigation summary link will be added
   513      */
   514     protected void addNavSummaryLink(List<?> members,
   515             VisibleMemberMap visibleMemberMap, Content liNav) {
   516         if (members.size() > 0) {
   517             liNav.addContent(getNavSummaryLink(null, true));
   518             return;
   519         }
   520         ClassDoc icd = classdoc.superclass();
   521         while (icd != null) {
   522             List<?> inhmembers = visibleMemberMap.getMembersFor(icd);
   523             if (inhmembers.size() > 0) {
   524                 liNav.addContent(getNavSummaryLink(icd, true));
   525                 return;
   526             }
   527             icd = icd.superclass();
   528         }
   529         liNav.addContent(getNavSummaryLink(null, false));
   530     }
   532     protected void serialWarning(SourcePosition pos, String key, String a1, String a2) {
   533         if (configuration.serialwarn) {
   534             configuration.getDocletSpecificMsg().warning(pos, key, a1, a2);
   535         }
   536     }
   538     public ProgramElementDoc[] eligibleMembers(ProgramElementDoc[] members) {
   539         return nodepr? Util.excludeDeprecatedMembers(members): members;
   540     }
   542     /**
   543      * Add the member summary for the given class.
   544      *
   545      * @param classDoc the class that is being documented
   546      * @param member the member being documented
   547      * @param firstSentenceTags the first sentence tags to be added to the summary
   548      * @param tableContents the list of contents to which the documentation will be added
   549      * @param counter the counter for determining id and style for the table row
   550      */
   551     public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
   552             Tag[] firstSentenceTags, List<Content> tableContents, int counter) {
   553         HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD);
   554         tdSummaryType.addStyle(HtmlStyle.colFirst);
   555         writer.addSummaryType(this, member, tdSummaryType);
   556         HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
   557         setSummaryColumnStyle(tdSummary);
   558         addSummaryLink(classDoc, member, tdSummary);
   559         writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary);
   560         HtmlTree tr = HtmlTree.TR(tdSummaryType);
   561         tr.addContent(tdSummary);
   562         if (member instanceof MethodDoc && !member.isAnnotationTypeElement()) {
   563             int methodType = (member.isStatic()) ? MethodTypes.STATIC.value() :
   564                     MethodTypes.INSTANCE.value();
   565             if (member.containingClass().isInterface()) {
   566                 methodType = (((MethodDoc) member).isAbstract())
   567                         ? methodType | MethodTypes.ABSTRACT.value()
   568                         : methodType | MethodTypes.DEFAULT.value();
   569             } else {
   570                 methodType = (((MethodDoc) member).isAbstract())
   571                         ? methodType | MethodTypes.ABSTRACT.value()
   572                         : methodType | MethodTypes.CONCRETE.value();
   573             }
   574             if (Util.isDeprecated(member) || Util.isDeprecated(classdoc)) {
   575                 methodType = methodType | MethodTypes.DEPRECATED.value();
   576             }
   577             methodTypesOr = methodTypesOr | methodType;
   578             String tableId = "i" + counter;
   579             typeMap.put(tableId, methodType);
   580             tr.addAttr(HtmlAttr.ID, tableId);
   581         }
   582         if (counter%2 == 0)
   583             tr.addStyle(HtmlStyle.altColor);
   584         else
   585             tr.addStyle(HtmlStyle.rowColor);
   586         tableContents.add(tr);
   587     }
   589     /**
   590      * Generate the method types set and return true if the method summary table
   591      * needs to show tabs.
   592      *
   593      * @return true if the table should show tabs
   594      */
   595     public boolean showTabs() {
   596         int value;
   597         for (MethodTypes type : EnumSet.allOf(MethodTypes.class)) {
   598             value = type.value();
   599             if ((value & methodTypesOr) == value) {
   600                 methodTypes.add(type);
   601             }
   602         }
   603         boolean showTabs = methodTypes.size() > 1;
   604         if (showTabs) {
   605             methodTypes.add(MethodTypes.ALL);
   606         }
   607         return showTabs;
   608     }
   610     /**
   611      * Set the style for the summary column.
   612      *
   613      * @param tdTree the column for which the style will be set
   614      */
   615     public void setSummaryColumnStyle(HtmlTree tdTree) {
   616         tdTree.addStyle(HtmlStyle.colLast);
   617     }
   619     /**
   620      * Add inherited member summary for the given class and member.
   621      *
   622      * @param classDoc the class the inherited member belongs to
   623      * @param nestedClass the inherited member that is summarized
   624      * @param isFirst true if this is the first member in the list
   625      * @param isLast true if this is the last member in the list
   626      * @param linksTree the content tree to which the summary will be added
   627      */
   628     public void addInheritedMemberSummary(ClassDoc classDoc,
   629             ProgramElementDoc nestedClass, boolean isFirst, boolean isLast,
   630             Content linksTree) {
   631         writer.addInheritedMemberSummary(this, classDoc, nestedClass, isFirst,
   632                 linksTree);
   633     }
   635     /**
   636      * Get the inherited summary header for the given class.
   637      *
   638      * @param classDoc the class the inherited member belongs to
   639      * @return a content tree for the inherited summary header
   640      */
   641     public Content getInheritedSummaryHeader(ClassDoc classDoc) {
   642         Content inheritedTree = writer.getMemberTreeHeader();
   643         writer.addInheritedSummaryHeader(this, classDoc, inheritedTree);
   644         return inheritedTree;
   645     }
   647     /**
   648      * Get the inherited summary links tree.
   649      *
   650      * @return a content tree for the inherited summary links
   651      */
   652     public Content getInheritedSummaryLinksTree() {
   653         return new HtmlTree(HtmlTag.CODE);
   654     }
   656     /**
   657      * Get the summary table tree for the given class.
   658      *
   659      * @param classDoc the class for which the summary table is generated
   660      * @param tableContents list of contents to be displayed in the summary table
   661      * @return a content tree for the summary table
   662      */
   663     public Content getSummaryTableTree(ClassDoc classDoc, List<Content> tableContents) {
   664         return writer.getSummaryTableTree(this, classDoc, tableContents, showTabs());
   665     }
   667     /**
   668      * Get the member tree to be documented.
   669      *
   670      * @param memberTree the content tree of member to be documented
   671      * @return a content tree that will be added to the class documentation
   672      */
   673     public Content getMemberTree(Content memberTree) {
   674         return writer.getMemberTree(memberTree);
   675     }
   677     /**
   678      * Get the member tree to be documented.
   679      *
   680      * @param memberTree the content tree of member to be documented
   681      * @param isLastContent true if the content to be added is the last content
   682      * @return a content tree that will be added to the class documentation
   683      */
   684     public Content getMemberTree(Content memberTree, boolean isLastContent) {
   685         if (isLastContent)
   686             return HtmlTree.UL(HtmlStyle.blockListLast, memberTree);
   687         else
   688             return HtmlTree.UL(HtmlStyle.blockList, memberTree);
   689     }
   690 }

mercurial