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

Tue, 14 May 2013 10:14:56 -0700

author
jjg
date
Tue, 14 May 2013 10:14:56 -0700
changeset 1750
081d7c72ee92
parent 1747
df4f44800923
child 1751
ca8808c88f94
permissions
-rw-r--r--

8012311: Cleanup names and duplicatre code in TagletManager
Reviewed-by: darcy

     1 /*
     2  * Copyright (c) 1997, 2013, 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 Content 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.Kind.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(LinkInfoImpl.Kind 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.
   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     }
   205     /**
   206      * Return a string describing the access modifier flags.
   207      * Don't include native or synchronized.
   208      *
   209      * The modifier names are returned in canonical order, as
   210      * specified by <em>The Java Language Specification</em>.
   211      */
   212     protected String modifierString(MemberDoc member) {
   213         int ms = member.modifierSpecifier();
   214         int no = Modifier.NATIVE | Modifier.SYNCHRONIZED;
   215     return Modifier.toString(ms & ~no);
   216     }
   218     protected String typeString(MemberDoc member) {
   219         String type = "";
   220         if (member instanceof MethodDoc) {
   221             type = ((MethodDoc)member).returnType().toString();
   222         } else if (member instanceof FieldDoc) {
   223             type = ((FieldDoc)member).type().toString();
   224         }
   225         return type;
   226     }
   228     /**
   229      * Add the modifier for the member.
   230      *
   231      * @param member the member for which teh modifier will be added.
   232      * @param htmltree the content tree to which the modifier information will be added.
   233      */
   234     protected void addModifiers(MemberDoc member, Content htmltree) {
   235         String mod = modifierString(member);
   236         // According to JLS, we should not be showing public modifier for
   237         // interface methods.
   238         if ((member.isField() || member.isMethod()) &&
   239             writer instanceof ClassWriterImpl &&
   240             ((ClassWriterImpl) writer).getClassDoc().isInterface()) {
   241             // This check for isDefault() and the default modifier needs to be
   242             // added for it to appear on the method details section. Once the
   243             // default modifier is added to the Modifier list on DocEnv and once
   244             // it is updated to use the javax.lang.model.element.Modifier, we
   245             // will need to remove this.
   246             mod = (member.isMethod() && ((MethodDoc)member).isDefault()) ?
   247                     Util.replaceText(mod, "public", "default").trim() :
   248                     Util.replaceText(mod, "public", "").trim();
   249         }
   250         if(mod.length() > 0) {
   251             htmltree.addContent(mod);
   252             htmltree.addContent(writer.getSpace());
   253         }
   254     }
   256     protected String makeSpace(int len) {
   257         if (len <= 0) {
   258             return "";
   259         }
   260         StringBuilder sb = new StringBuilder(len);
   261         for (int i = 0; i < len; i++) {
   262             sb.append(' ');
   263     }
   264         return sb.toString();
   265     }
   267     /**
   268      * Add the modifier and type for the member in the member summary.
   269      *
   270      * @param member the member to add the type for
   271      * @param type the type to add
   272      * @param tdSummaryType the content tree to which the modified and type will be added
   273      */
   274     protected void addModifierAndType(ProgramElementDoc member, Type type,
   275             Content tdSummaryType) {
   276         HtmlTree code = new HtmlTree(HtmlTag.CODE);
   277         addModifier(member, code);
   278         if (type == null) {
   279             if (member.isClass()) {
   280                 code.addContent("class");
   281             } else {
   282                 code.addContent("interface");
   283             }
   284             code.addContent(writer.getSpace());
   285         } else {
   286             if (member instanceof ExecutableMemberDoc &&
   287                     ((ExecutableMemberDoc) member).typeParameters().length > 0) {
   288                 Content typeParameters = ((AbstractExecutableMemberWriter) this).getTypeParameters(
   289                         (ExecutableMemberDoc) member);
   290                     code.addContent(typeParameters);
   291                 //Code to avoid ugly wrapping in member summary table.
   292                 if (typeParameters.charCount() > 10) {
   293                     code.addContent(new HtmlTree(HtmlTag.BR));
   294                 } else {
   295                     code.addContent(writer.getSpace());
   296                 }
   297                 code.addContent(
   298                         writer.getLink(new LinkInfoImpl(configuration,
   299                         LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type)));
   300             } else {
   301                 code.addContent(
   302                         writer.getLink(new LinkInfoImpl(configuration,
   303                         LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type)));
   304             }
   306         }
   307         tdSummaryType.addContent(code);
   308     }
   310     /**
   311      * Add the modifier for the member.
   312      *
   313      * @param member the member to add the type for
   314      * @param code the content tree to which the modified will be added
   315      */
   316     private void addModifier(ProgramElementDoc member, Content code) {
   317         if (member.isProtected()) {
   318             code.addContent("protected ");
   319         } else if (member.isPrivate()) {
   320             code.addContent("private ");
   321         } else if (!member.isPublic()) { // Package private
   322             code.addContent(configuration.getText("doclet.Package_private"));
   323             code.addContent(" ");
   324         }
   325         if (member.isMethod()) {
   326             if (!(member.containingClass().isInterface()) &&
   327                     ((MethodDoc)member).isAbstract()) {
   328                 code.addContent("abstract ");
   329             }
   330             // This check for isDefault() and the default modifier needs to be
   331             // added for it to appear on the "Modifier and Type" column in the
   332             // method summary section. Once the default modifier is added
   333             // to the Modifier list on DocEnv and once it is updated to use the
   334             // javax.lang.model.element.Modifier, we will need to remove this.
   335             if (((MethodDoc)member).isDefault()) {
   336                 code.addContent("default ");
   337             }
   338         }
   339         if (member.isStatic()) {
   340             code.addContent("static ");
   341         }
   342     }
   344     /**
   345      * Add the deprecated information for the given member.
   346      *
   347      * @param member the member being documented.
   348      * @param contentTree the content tree to which the deprecated information will be added.
   349      */
   350     protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) {
   351         TagletOutput output = (new DeprecatedTaglet()).getTagletOutput(member,
   352             writer.getTagletWriterInstance(false));
   353         Content body = ((TagletOutputImpl) output).getContent();
   354         if (!body.isEmpty()) {
   355             Content deprecatedContent = body;
   356             Content div = HtmlTree.DIV(HtmlStyle.block, deprecatedContent);
   357             contentTree.addContent(div);
   358         }
   359     }
   361     /**
   362      * Add the comment for the given member.
   363      *
   364      * @param member the member being documented.
   365      * @param htmltree the content tree to which the comment will be added.
   366      */
   367     protected void addComment(ProgramElementDoc member, Content htmltree) {
   368         if (member.inlineTags().length > 0) {
   369             writer.addInlineComment(member, htmltree);
   370         }
   371     }
   373     protected String name(ProgramElementDoc member) {
   374         return member.name();
   375     }
   377     /**
   378      * Get the header for the section.
   379      *
   380      * @param member the member being documented.
   381      * @return a header content for the section.
   382      */
   383     protected Content getHead(MemberDoc member) {
   384         Content memberContent = new StringContent(member.name());
   385         Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent);
   386         return heading;
   387     }
   389     /**
   390     * Return true if the given <code>ProgramElement</code> is inherited
   391     * by the class that is being documented.
   392     *
   393     * @param ped The <code>ProgramElement</code> being checked.
   394     * return true if the <code>ProgramElement</code> is being inherited and
   395     * false otherwise.
   396     */
   397     protected boolean isInherited(ProgramElementDoc ped){
   398         if(ped.isPrivate() || (ped.isPackagePrivate() &&
   399             ! ped.containingPackage().equals(classdoc.containingPackage()))){
   400             return false;
   401         }
   402         return true;
   403     }
   405     /**
   406      * Add deprecated information to the documentation tree
   407      *
   408      * @param deprmembers list of deprecated members
   409      * @param headingKey the caption for the deprecated members table
   410      * @param tableSummary the summary for the deprecated members table
   411      * @param tableHeader table headers for the deprecated members table
   412      * @param contentTree the content tree to which the deprecated members table will be added
   413      */
   414     protected void addDeprecatedAPI(List<Doc> deprmembers, String headingKey,
   415             String tableSummary, String[] tableHeader, Content contentTree) {
   416         if (deprmembers.size() > 0) {
   417             Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
   418                 writer.getTableCaption(configuration.getResource(headingKey)));
   419             table.addContent(writer.getSummaryTableHeader(tableHeader, "col"));
   420             Content tbody = new HtmlTree(HtmlTag.TBODY);
   421             for (int i = 0; i < deprmembers.size(); i++) {
   422                 ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i);
   423                 HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, getDeprecatedLink(member));
   424                 if (member.tags("deprecated").length > 0)
   425                     writer.addInlineDeprecatedComment(member,
   426                             member.tags("deprecated")[0], td);
   427                 HtmlTree tr = HtmlTree.TR(td);
   428                 if (i%2 == 0)
   429                     tr.addStyle(HtmlStyle.altColor);
   430                 else
   431                     tr.addStyle(HtmlStyle.rowColor);
   432                 tbody.addContent(tr);
   433             }
   434             table.addContent(tbody);
   435             Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   436             Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
   437             contentTree.addContent(ul);
   438         }
   439     }
   441     /**
   442      * Add use information to the documentation tree.
   443      *
   444      * @param mems list of program elements for which the use information will be added
   445      * @param heading the section heading
   446      * @param tableSummary the summary for the use table
   447      * @param contentTree the content tree to which the use information will be added
   448      */
   449     protected void addUseInfo(List<? extends ProgramElementDoc> mems,
   450             Content heading, String tableSummary, Content contentTree) {
   451         if (mems == null) {
   452             return;
   453         }
   454         List<? extends ProgramElementDoc> members = mems;
   455         boolean printedUseTableHeader = false;
   456         if (members.size() > 0) {
   457             Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
   458                     writer.getTableCaption(heading));
   459             Content tbody = new HtmlTree(HtmlTag.TBODY);
   460             Iterator<? extends ProgramElementDoc> it = members.iterator();
   461             for (int i = 0; it.hasNext(); i++) {
   462                 ProgramElementDoc pgmdoc = it.next();
   463                 ClassDoc cd = pgmdoc.containingClass();
   464                 if (!printedUseTableHeader) {
   465                     table.addContent(writer.getSummaryTableHeader(
   466                             this.getSummaryTableHeader(pgmdoc), "col"));
   467                     printedUseTableHeader = true;
   468                 }
   469                 HtmlTree tr = new HtmlTree(HtmlTag.TR);
   470                 if (i % 2 == 0) {
   471                     tr.addStyle(HtmlStyle.altColor);
   472                 } else {
   473                     tr.addStyle(HtmlStyle.rowColor);
   474                 }
   475                 HtmlTree tdFirst = new HtmlTree(HtmlTag.TD);
   476                 tdFirst.addStyle(HtmlStyle.colFirst);
   477                 writer.addSummaryType(this, pgmdoc, tdFirst);
   478                 tr.addContent(tdFirst);
   479                 HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
   480                 tdLast.addStyle(HtmlStyle.colLast);
   481                 if (cd != null && !(pgmdoc instanceof ConstructorDoc)
   482                         && !(pgmdoc instanceof ClassDoc)) {
   483                     HtmlTree name = new HtmlTree(HtmlTag.SPAN);
   484                     name.addStyle(HtmlStyle.strong);
   485                     name.addContent(cd.name() + ".");
   486                     tdLast.addContent(name);
   487                 }
   488                 addSummaryLink(pgmdoc instanceof ClassDoc ?
   489                     LinkInfoImpl.Kind.CLASS_USE : LinkInfoImpl.Kind.MEMBER,
   490                     cd, pgmdoc, tdLast);
   491                 writer.addSummaryLinkComment(this, pgmdoc, tdLast);
   492                 tr.addContent(tdLast);
   493                 tbody.addContent(tr);
   494             }
   495             table.addContent(tbody);
   496             contentTree.addContent(table);
   497         }
   498     }
   500     /**
   501      * Add the navigation detail link.
   502      *
   503      * @param members the members to be linked
   504      * @param liNav the content tree to which the navigation detail link will be added
   505      */
   506     protected void addNavDetailLink(List<?> members, Content liNav) {
   507         addNavDetailLink(members.size() > 0 ? true : false, liNav);
   508     }
   510     /**
   511      * Add the navigation summary link.
   512      *
   513      * @param members members to be linked
   514      * @param visibleMemberMap the visible inherited members map
   515      * @param liNav the content tree to which the navigation summary link will be added
   516      */
   517     protected void addNavSummaryLink(List<?> members,
   518             VisibleMemberMap visibleMemberMap, Content liNav) {
   519         if (members.size() > 0) {
   520             liNav.addContent(getNavSummaryLink(null, true));
   521             return;
   522         }
   523         ClassDoc icd = classdoc.superclass();
   524         while (icd != null) {
   525             List<?> inhmembers = visibleMemberMap.getMembersFor(icd);
   526             if (inhmembers.size() > 0) {
   527                 liNav.addContent(getNavSummaryLink(icd, true));
   528                 return;
   529             }
   530             icd = icd.superclass();
   531         }
   532         liNav.addContent(getNavSummaryLink(null, false));
   533     }
   535     protected void serialWarning(SourcePosition pos, String key, String a1, String a2) {
   536         if (configuration.serialwarn) {
   537             configuration.getDocletSpecificMsg().warning(pos, key, a1, a2);
   538         }
   539     }
   541     public ProgramElementDoc[] eligibleMembers(ProgramElementDoc[] members) {
   542         return nodepr? Util.excludeDeprecatedMembers(members): members;
   543     }
   545     /**
   546      * Add the member summary for the given class.
   547      *
   548      * @param classDoc the class that is being documented
   549      * @param member the member being documented
   550      * @param firstSentenceTags the first sentence tags to be added to the summary
   551      * @param tableContents the list of contents to which the documentation will be added
   552      * @param counter the counter for determining id and style for the table row
   553      */
   554     public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
   555             Tag[] firstSentenceTags, List<Content> tableContents, int counter) {
   556         HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD);
   557         tdSummaryType.addStyle(HtmlStyle.colFirst);
   558         writer.addSummaryType(this, member, tdSummaryType);
   559         HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
   560         setSummaryColumnStyle(tdSummary);
   561         addSummaryLink(classDoc, member, tdSummary);
   562         writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary);
   563         HtmlTree tr = HtmlTree.TR(tdSummaryType);
   564         tr.addContent(tdSummary);
   565         if (member instanceof MethodDoc && !member.isAnnotationTypeElement()) {
   566             int methodType = (member.isStatic()) ? MethodTypes.STATIC.value() :
   567                     MethodTypes.INSTANCE.value();
   568             if (member.containingClass().isInterface()) {
   569                 methodType = (((MethodDoc) member).isAbstract())
   570                         ? methodType | MethodTypes.ABSTRACT.value()
   571                         : methodType | MethodTypes.DEFAULT.value();
   572             } else {
   573                 methodType = (((MethodDoc) member).isAbstract())
   574                         ? methodType | MethodTypes.ABSTRACT.value()
   575                         : methodType | MethodTypes.CONCRETE.value();
   576             }
   577             if (Util.isDeprecated(member) || Util.isDeprecated(classdoc)) {
   578                 methodType = methodType | MethodTypes.DEPRECATED.value();
   579             }
   580             methodTypesOr = methodTypesOr | methodType;
   581             String tableId = "i" + counter;
   582             typeMap.put(tableId, methodType);
   583             tr.addAttr(HtmlAttr.ID, tableId);
   584         }
   585         if (counter%2 == 0)
   586             tr.addStyle(HtmlStyle.altColor);
   587         else
   588             tr.addStyle(HtmlStyle.rowColor);
   589         tableContents.add(tr);
   590     }
   592     /**
   593      * Generate the method types set and return true if the method summary table
   594      * needs to show tabs.
   595      *
   596      * @return true if the table should show tabs
   597      */
   598     public boolean showTabs() {
   599         int value;
   600         for (MethodTypes type : EnumSet.allOf(MethodTypes.class)) {
   601             value = type.value();
   602             if ((value & methodTypesOr) == value) {
   603                 methodTypes.add(type);
   604             }
   605         }
   606         boolean showTabs = methodTypes.size() > 1;
   607         if (showTabs) {
   608             methodTypes.add(MethodTypes.ALL);
   609         }
   610         return showTabs;
   611     }
   613     /**
   614      * Set the style for the summary column.
   615      *
   616      * @param tdTree the column for which the style will be set
   617      */
   618     public void setSummaryColumnStyle(HtmlTree tdTree) {
   619         tdTree.addStyle(HtmlStyle.colLast);
   620     }
   622     /**
   623      * Add inherited member summary for the given class and member.
   624      *
   625      * @param classDoc the class the inherited member belongs to
   626      * @param nestedClass the inherited member that is summarized
   627      * @param isFirst true if this is the first member in the list
   628      * @param isLast true if this is the last member in the list
   629      * @param linksTree the content tree to which the summary will be added
   630      */
   631     public void addInheritedMemberSummary(ClassDoc classDoc,
   632             ProgramElementDoc nestedClass, boolean isFirst, boolean isLast,
   633             Content linksTree) {
   634         writer.addInheritedMemberSummary(this, classDoc, nestedClass, isFirst,
   635                 linksTree);
   636     }
   638     /**
   639      * Get the inherited summary header for the given class.
   640      *
   641      * @param classDoc the class the inherited member belongs to
   642      * @return a content tree for the inherited summary header
   643      */
   644     public Content getInheritedSummaryHeader(ClassDoc classDoc) {
   645         Content inheritedTree = writer.getMemberTreeHeader();
   646         writer.addInheritedSummaryHeader(this, classDoc, inheritedTree);
   647         return inheritedTree;
   648     }
   650     /**
   651      * Get the inherited summary links tree.
   652      *
   653      * @return a content tree for the inherited summary links
   654      */
   655     public Content getInheritedSummaryLinksTree() {
   656         return new HtmlTree(HtmlTag.CODE);
   657     }
   659     /**
   660      * Get the summary table tree for the given class.
   661      *
   662      * @param classDoc the class for which the summary table is generated
   663      * @param tableContents list of contents to be displayed in the summary table
   664      * @return a content tree for the summary table
   665      */
   666     public Content getSummaryTableTree(ClassDoc classDoc, List<Content> tableContents) {
   667         return writer.getSummaryTableTree(this, classDoc, tableContents, showTabs());
   668     }
   670     /**
   671      * Get the member tree to be documented.
   672      *
   673      * @param memberTree the content tree of member to be documented
   674      * @return a content tree that will be added to the class documentation
   675      */
   676     public Content getMemberTree(Content memberTree) {
   677         return writer.getMemberTree(memberTree);
   678     }
   680     /**
   681      * Get the member tree to be documented.
   682      *
   683      * @param memberTree the content tree of member to be documented
   684      * @param isLastContent true if the content to be added is the last content
   685      * @return a content tree that will be added to the class documentation
   686      */
   687     public Content getMemberTree(Content memberTree, boolean isLastContent) {
   688         if (isLastContent)
   689             return HtmlTree.UL(HtmlStyle.blockListLast, memberTree);
   690         else
   691             return HtmlTree.UL(HtmlStyle.blockList, memberTree);
   692     }
   693 }

mercurial