langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java
author bpatel
Thu, 08 Jan 2009 16:26:59 -0800
changeset 1787 1aa079321cd2
parent 1264 076a3cde30d5
child 1789 7ac8c0815000
permissions -rw-r--r--
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
1264
076a3cde30d5 6754988: Update copyright year
xdono
parents: 868
diff changeset
     2
 * Copyright 1997-2008 Sun Microsystems, Inc.  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
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.tools.doclets.internal.toolkit.taglets.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.javadoc.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
import java.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import java.io.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * Writes constructor documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
    implements ConstructorWriter, MemberSummaryWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
    private boolean foundNonPubConstructor = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    private boolean printedSummaryHeader = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
     * Construct a new ConstructorWriterImpl.
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
     * @param writer The writer for the class that the constructors belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * @param classDoc the class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    public ConstructorWriterImpl(SubWriterHolderWriter writer,
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
            ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
        super(writer, classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
        VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
            VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated);
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    58
        List<ProgramElementDoc> constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
        for (int i = 0; i < constructors.size(); i++) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    60
            if ((constructors.get(i)).isProtected() ||
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    61
                (constructors.get(i)).isPrivate()) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
                setFoundNonPubConstructor(true);
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * Construct a new ConstructorWriterImpl.
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * @param writer The writer for the class that the constructors belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    public ConstructorWriterImpl(SubWriterHolderWriter writer) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
        super(writer);
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     * Write the constructors summary header for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    public void writeMemberSummaryHeader(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
        printedSummaryHeader = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
        writer.println("<!-- ======== CONSTRUCTOR SUMMARY ======== -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
        writer.printSummaryHeader(this, classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     * Write the constructors summary footer for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    public void writeMemberSummaryFooter(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
        writer.printSummaryFooter(this, classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     * Write the header for the constructor documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     * @param classDoc the class that the constructors belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
    public void writeHeader(ClassDoc classDoc, String header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
        writer.println("<!-- ========= CONSTRUCTOR DETAIL ======== -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
        writer.anchor("constructor_detail");
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
        writer.printTableHeadingBackground(header);
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     * Write the constructor header for the given constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
     * @param constructor the constructor being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
     * @param isFirst the flag to indicate whether or not the constructor is the
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     *        first to be documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
    public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        if (! isFirst) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
            writer.printMemberHeader();
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
        String erasureAnchor;
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        if ((erasureAnchor = getErasureAnchor(constructor)) != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
            writer.anchor(erasureAnchor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
        writer.anchor(constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
        writer.h3();
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        writer.print(constructor.name());
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        writer.h3End();
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
     * Write the signature for the given constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     * @param constructor the constructor being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
    public void writeSignature(ConstructorDoc constructor) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        writer.displayLength = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        writer.pre();
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
        writer.writeAnnotationInfo(constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        printModifiers(constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
        //printReturnType((ConstructorDoc)constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        if (configuration().linksource) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
            writer.printSrcLink(constructor, constructor.name());
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
   147
            strong(constructor.name());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        writeParameters(constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        writeExceptions(constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
        writer.preEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        writer.dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
     * Write the deprecated output for the given constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     * @param constructor the constructor being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    public void writeDeprecated(ConstructorDoc constructor) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        String output = ((TagletOutputImpl)
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
            (new DeprecatedTaglet()).getTagletOutput(constructor,
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
            writer.getTagletWriterInstance(false))).toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
        if (output != null && output.trim().length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
            writer.print(output);
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
     * Write the comments for the given constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     * @param constructor the constructor being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
    public void writeComments(ConstructorDoc constructor) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
        if (constructor.inlineTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
            writer.dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
            writer.printInlineComment(constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
     * Write the tag output for the given constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
     * @param constructor the constructor being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
    public void writeTags(ConstructorDoc constructor) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        writer.printTags(constructor);
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
     * Write the constructor footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    public void writeConstructorFooter() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
        writer.dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
     * Write the footer for the constructor documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
     * @param classDoc the class that the constructors belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
    public void writeFooter(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
        //No footer to write for constructor documentation
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     * Close the writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    public void close() throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
        writer.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     * Let the writer know whether a non public constructor was found.
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
     * @param foundNonPubConstructor true if we found a non public constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
    public void setFoundNonPubConstructor(boolean foundNonPubConstructor) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
        this.foundNonPubConstructor = foundNonPubConstructor;
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    public void printSummaryLabel(ClassDoc cd) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
   223
        writer.strongText("doclet.Constructor_Summary");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
    public void printSummaryAnchor(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
        writer.anchor("constructor_summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
    public void printInheritedSummaryAnchor(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    }   // no such
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    public void printInheritedSummaryLabel(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
        // no such
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
    public int getMemberKind() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
        return VisibleMemberMap.CONSTRUCTORS;
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    protected void navSummaryLink(List members) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
        printNavSummaryLink(classdoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
                members.size() > 0? true: false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
        if (link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
            writer.printHyperLink("", "constructor_summary",
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
                    ConfigurationImpl.getInstance().getText("doclet.navConstructor"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
            writer.printText("doclet.navConstructor");
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
    protected void printNavDetailLink(boolean link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
        if (link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
            writer.printHyperLink("", "constructor_detail",
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
                    ConfigurationImpl.getInstance().getText("doclet.navConstructor"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
            writer.printText("doclet.navConstructor");
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    protected void printSummaryType(ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
        if (foundNonPubConstructor) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
            writer.printTypeSummaryHeader();
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
            if (member.isProtected()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
                print("protected ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
            } else if (member.isPrivate()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
                print("private ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
            } else if (member.isPublic()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
                writer.space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
                writer.printText("doclet.Package_private");
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
            writer.printTypeSummaryFooter();
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
     * Write the inherited member summary header for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
        if(! printedSummaryHeader){
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
            //We don't want inherited summary to not be under heading.
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
            writeMemberSummaryHeader(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
            writeMemberSummaryFooter(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
            printedSummaryHeader = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
    public void writeInheritedMemberSummary(ClassDoc classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
        ProgramElementDoc member, boolean isFirst, boolean isLast) {}
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
     * Write the inherited member summary footer for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {}
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
}