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