src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 55339 0530705ca300
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
53991
786825220790 8219801: Pages do not have <h1>
jjg
parents: 53883
diff changeset
     2
 * Copyright (c) 1997, 2019, 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
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
    28
import java.util.Arrays;
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
    29
import java.util.List;
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
    30
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    31
import javax.lang.model.element.Element;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    32
import javax.lang.model.element.ExecutableElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    33
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    34
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
    35
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
54610
a9ab154b1384 8222669: Create and use new html.Entity class
jjg
parents: 54596
diff changeset
    36
import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    37
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    38
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    39
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
55339
0530705ca300 8223364: Bad placement of anchor relative to header
hannesw
parents: 55232
diff changeset
    40
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
    41
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
    42
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    43
import jdk.javadoc.internal.doclets.toolkit.ConstructorWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    44
import jdk.javadoc.internal.doclets.toolkit.Content;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    45
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
49879
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 49551
diff changeset
    46
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 49551
diff changeset
    47
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
    48
import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.CONSTRUCTORS;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    49
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 * Writes constructor documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    54
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    55
 *  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: 7681
diff changeset
    56
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    57
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    58
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
 * @author Atul M Dambalkar
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
    61
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    implements ConstructorWriter, MemberSummaryWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    private boolean foundNonPubConstructor = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * Construct a new ConstructorWriterImpl.
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * @param writer The writer for the class that the constructors belong to.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    72
     * @param typeElement the class being documented.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    74
    public ConstructorWriterImpl(SubWriterHolderWriter writer, TypeElement typeElement) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    75
        super(writer, typeElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    76
49879
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 49551
diff changeset
    77
        VisibleMemberTable vmt = configuration.getVisibleMemberTable(typeElement);
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 49551
diff changeset
    78
        List<? extends Element> constructors = vmt.getVisibleMembers(CONSTRUCTORS);
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 49551
diff changeset
    79
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    80
        for (Element constructor : constructors) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    81
            if (utils.isProtected(constructor) || utils.isPrivate(constructor)) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
                setFoundNonPubConstructor(true);
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     * Construct a new ConstructorWriterImpl.
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     * @param writer The writer for the class that the constructors belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    public ConstructorWriterImpl(SubWriterHolderWriter writer) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
        super(writer);
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    97
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
    99
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   100
    public Content getMemberSummaryHeader(TypeElement typeElement,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   101
            Content memberSummaryTree) {
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   102
        memberSummaryTree.add(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY);
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   103
        Content memberTree = new ContentBuilder();
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   104
        writer.addSummaryHeader(this, typeElement, memberTree);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   105
        return memberTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   109
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     */
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   111
    @Override
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   112
    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   113
        writer.addMemberTree(HtmlStyle.constructorSummary, memberSummaryTree, memberTree);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   114
    }
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   115
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   116
    /**
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   117
     * {@inheritDoc}
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   118
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   119
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   120
    public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
            Content memberDetailsTree) {
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   122
        memberDetailsTree.add(MarkerComments.START_OF_CONSTRUCTOR_DETAILS);
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   123
        Content constructorDetailsTree = new ContentBuilder();
53991
786825220790 8219801: Pages do not have <h1>
jjg
parents: 53883
diff changeset
   124
        Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   125
                contents.constructorDetailsLabel);
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   126
        constructorDetailsTree.add(links.createAnchor(
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   127
                SectionName.CONSTRUCTOR_DETAIL));
55339
0530705ca300 8223364: Bad placement of anchor relative to header
hannesw
parents: 55232
diff changeset
   128
        constructorDetailsTree.add(heading);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   129
        return constructorDetailsTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   133
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   135
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   136
    public Content getConstructorDocTreeHeader(ExecutableElement constructor,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   137
            Content constructorDetailsTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
        String erasureAnchor;
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   139
        Content constructorDocTree = new ContentBuilder();
53991
786825220790 8219801: Pages do not have <h1>
jjg
parents: 53883
diff changeset
   140
        Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
55339
0530705ca300 8223364: Bad placement of anchor relative to header
hannesw
parents: 55232
diff changeset
   141
        if ((erasureAnchor = getErasureAnchor(constructor)) != null) {
0530705ca300 8223364: Bad placement of anchor relative to header
hannesw
parents: 55232
diff changeset
   142
            heading.add(links.createAnchor((erasureAnchor)));
0530705ca300 8223364: Bad placement of anchor relative to header
hannesw
parents: 55232
diff changeset
   143
        }
0530705ca300 8223364: Bad placement of anchor relative to header
hannesw
parents: 55232
diff changeset
   144
        heading.add(links.createAnchor(writer.getAnchor(constructor), new StringContent(name(constructor))));
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   145
        constructorDocTree.add(heading);
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   146
        return HtmlTree.SECTION(HtmlStyle.detail, constructorDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   150
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   152
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   153
    public Content getSignature(ExecutableElement constructor) {
55197
0ca8e495bbba 8214126: Method signatures not formatted correctly in browser
hannesw
parents: 54610
diff changeset
   154
        return new MemberSignature(constructor)
0ca8e495bbba 8214126: Method signatures not formatted correctly in browser
hannesw
parents: 54610
diff changeset
   155
                .addParameters(getParameters(constructor, true))
0ca8e495bbba 8214126: Method signatures not formatted correctly in browser
hannesw
parents: 54610
diff changeset
   156
                .addExceptions(getExceptions(constructor))
0ca8e495bbba 8214126: Method signatures not formatted correctly in browser
hannesw
parents: 54610
diff changeset
   157
                .toContent();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   161
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   163
    @Override
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   164
    public void addDeprecated(ExecutableElement constructor, Content constructorDocTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   165
        addDeprecatedInfo(constructor, constructorDocTree);
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
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   168
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   169
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   170
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   171
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   172
    public void addComments(ExecutableElement constructor, Content constructorDocTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   173
        addComment(constructor, constructorDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   177
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   179
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   180
    public void addTags(ExecutableElement constructor, Content constructorDocTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   181
        writer.addTagsInfo(constructor, constructorDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   185
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   187
    @Override
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   188
    public Content getConstructorDetails(Content constructorDetailsTreeHeader, Content constructorDetailsTree) {
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   189
        Content constructorDetails = new ContentBuilder(constructorDetailsTreeHeader, constructorDetailsTree);
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   190
        return getMemberTree(HtmlTree.SECTION(HtmlStyle.constructorDetails, constructorDetails));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   194
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   196
    @Override
55232
9b392b044f64 8221709: replace use of style blockListLast
hannesw
parents: 55197
diff changeset
   197
    public Content getConstructorDoc(Content constructorDocTree) {
9b392b044f64 8221709: replace use of style blockListLast
hannesw
parents: 55197
diff changeset
   198
        return getMemberTree(constructorDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
     * Let the writer know whether a non public constructor was found.
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
     * @param foundNonPubConstructor true if we found a non public constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   206
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
    public void setFoundNonPubConstructor(boolean foundNonPubConstructor) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
        this.foundNonPubConstructor = foundNonPubConstructor;
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   211
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   212
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   213
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   214
    @Override
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   215
    public void addSummaryLabel(Content memberTree) {
53991
786825220790 8219801: Pages do not have <h1>
jjg
parents: 53883
diff changeset
   216
        Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   217
                contents.constructorSummaryLabel);
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   218
        memberTree.add(label);
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   219
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   220
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   221
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   222
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   223
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   224
    @Override
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   225
    public TableHeader getSummaryTableHeader(Element member) {
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   226
        if (foundNonPubConstructor) {
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   227
            return new TableHeader(contents.modifierLabel, contents.constructorLabel,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   228
                    contents.descriptionLabel);
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   229
        } else {
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   230
            return new TableHeader(contents.constructorLabel, contents.descriptionLabel);
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   231
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   232
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   233
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   234
    @Override
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   235
    protected Table createSummaryTable() {
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   236
        List<HtmlStyle> bodyRowStyles;
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   237
        int rowScopeColumn;
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   238
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   239
        if (foundNonPubConstructor) {
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   240
            bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colConstructorName,
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   241
                    HtmlStyle.colLast);
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   242
            rowScopeColumn = 1;
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   243
        } else {
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   244
            bodyRowStyles = Arrays.asList(HtmlStyle.colConstructorName, HtmlStyle.colLast);
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   245
            rowScopeColumn = 0;
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   246
        }
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   247
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   248
        return new Table(HtmlStyle.memberSummary)
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   249
                .setCaption(contents.constructors)
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   250
                .setHeader(getSummaryTableHeader(typeElement))
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   251
                .setRowScopeColumn(rowScopeColumn)
51260
b7a307084247 8203791: Remove "compatibility" features from Table.java
pmuthuswamy
parents: 49879
diff changeset
   252
                .setColumnStyles(bodyRowStyles);
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   253
    }
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   254
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   256
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   257
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   258
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   259
    public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   260
        memberTree.add(links.createAnchor(SectionName.CONSTRUCTOR_SUMMARY));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   263
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   264
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   265
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   266
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   267
    public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   270
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   271
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   272
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   273
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   274
    public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   277
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   278
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   279
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   280
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   281
    protected void addSummaryType(Element member, Content tdSummaryType) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   282
        if (foundNonPubConstructor) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   283
            Content code = new HtmlTree(HtmlTag.CODE);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   284
            if (utils.isProtected(member)) {
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   285
                code.add("protected ");
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   286
            } else if (utils.isPrivate(member)) {
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   287
                code.add("private ");
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31943
diff changeset
   288
            } else if (utils.isPublic(member)) {
54610
a9ab154b1384 8222669: Create and use new html.Entity class
jjg
parents: 54596
diff changeset
   289
                code.add(Entity.NO_BREAK_SPACE);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   290
            } else {
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   291
                code.add(
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 51260
diff changeset
   292
                        resources.getText("doclet.Package_private"));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   293
            }
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 53991
diff changeset
   294
            tdSummaryType.add(code);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   295
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   296
    }
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   297
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   298
    @Override
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   299
    public Content getMemberTreeHeader(){
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   300
        return writer.getMemberTreeHeader();
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   301
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
}