langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java
author jjg
Wed, 10 Oct 2012 16:48:21 -0700
changeset 14260 727a84636f12
parent 7681 1f0819a3341f
child 14357 faf9cde2817b
permissions -rw-r--r--
8000665: fix "internal API" comments on javadoc files Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
     2
 * Copyright (c) 1997, 2012, 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
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    28
import java.io.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    29
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    30
import com.sun.javadoc.*;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    31
import com.sun.tools.doclets.formats.html.markup.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.util.*;
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 method documentation in HTML format.
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    38
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    39
 *  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
    40
 *  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
    41
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    42
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * @author Jamie Ho (rewrite)
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
    46
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
public class MethodWriterImpl extends AbstractExecutableMemberWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
        implements MethodWriter, MemberSummaryWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     * Construct a new MethodWriterImpl.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * @param writer the writer for the class that the methods belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     * @param classDoc the class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    public MethodWriterImpl(SubWriterHolderWriter writer, ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
        super(writer, classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * Construct a new MethodWriterImpl.
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
     * @param writer The writer for the class that the methods belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    public MethodWriterImpl(SubWriterHolderWriter writer) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
        super(writer);
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    71
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    73
    public Content getMemberSummaryHeader(ClassDoc classDoc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    74
            Content memberSummaryTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    75
        memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    76
        Content memberTree = writer.getMemberTreeHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    77
        writer.addSummaryHeader(this, classDoc, memberTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    78
        return memberTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    82
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    84
    public Content getMethodDetailsTreeHeader(ClassDoc classDoc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    85
            Content memberDetailsTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    86
        memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    87
        Content methodDetailsTree = writer.getMemberTreeHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    88
        methodDetailsTree.addContent(writer.getMarkerAnchor("method_detail"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    89
        Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    90
                writer.methodDetailsLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    91
        methodDetailsTree.addContent(heading);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    92
        return methodDetailsTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    98
    public Content getMethodDocTreeHeader(MethodDoc method,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    99
            Content methodDetailsTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
        String erasureAnchor;
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
        if ((erasureAnchor = getErasureAnchor(method)) != null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   102
            methodDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor)));
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
        methodDetailsTree.addContent(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   105
                writer.getMarkerAnchor(writer.getAnchor(method)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   106
        Content methodDocTree = writer.getMemberTreeHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   107
        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   108
        heading.addContent(method.name());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   109
        methodDocTree.addContent(heading);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   110
        return methodDocTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   114
     * Get the signature for the given method.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     * @param method the method being documented.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
     * @return a content object for the signature
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   119
    public Content getSignature(MethodDoc method) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
        writer.displayLength = 0;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
        Content pre = new HtmlTree(HtmlTag.PRE);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   122
        writer.addAnnotationInfo(method, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   123
        addModifiers(method, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   124
        addTypeParameters(method, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   125
        addReturnType(method, pre);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
        if (configuration().linksource) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   127
            Content methodName = new StringContent(method.name());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   128
            writer.addSrcLink(method, methodName, pre);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   130
            addName(method.name(), pre);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   132
        addParameters(method, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   133
        addExceptions(method, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   134
        return pre;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   138
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   140
    public void addDeprecated(MethodDoc method, Content methodDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   141
        addDeprecatedInfo(method, methodDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   145
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   147
    public void addComments(Type holder, MethodDoc method, Content methodDocTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        ClassDoc holderClassDoc = holder.asClassDoc();
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        if (method.inlineTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
            if (holder.asClassDoc().equals(classdoc) ||
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   151
                    (! (holderClassDoc.isPublic() ||
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
                    Util.isLinkable(holderClassDoc, configuration())))) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   153
                writer.addInlineComment(method, methodDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
            } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   155
                Content link = new RawHtml(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   156
                        writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
                        holder.asClassDoc(), method,
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
                        holder.asClassDoc().isIncluded() ?
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
                            holder.typeName() : holder.qualifiedTypeName(),
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   160
                            false));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   161
                Content codelLink = HtmlTree.CODE(link);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   162
                Content strong = HtmlTree.STRONG(holder.asClassDoc().isClass()?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   163
                    writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   164
                strong.addContent(writer.getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   165
                strong.addContent(codelLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   166
                methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   167
                writer.addInlineComment(method, methodDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   173
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   175
    public void addTags(MethodDoc method, Content methodDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   176
        writer.addTagsInfo(method, methodDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   180
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   182
    public Content getMethodDetails(Content methodDetailsTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   183
        return getMemberTree(methodDetailsTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
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
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   189
    public Content getMethodDoc(Content methodDocTree,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   190
            boolean isLastContent) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   191
        return getMemberTree(methodDocTree, isLastContent);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
     * Close the writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
    public void close() throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        writer.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    public int getMemberKind() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
        return VisibleMemberMap.METHODS;
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   205
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   206
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   207
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   208
    public void addSummaryLabel(Content memberTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   209
        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   210
                writer.getResource("doclet.Method_Summary"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   211
        memberTree.addContent(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
   212
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   213
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   214
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   215
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   216
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   217
    public String getTableSummary() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   218
        return configuration().getText("doclet.Member_Table_Summary",
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
                configuration().getText("doclet.Method_Summary"),
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   220
                configuration().getText("doclet.methods"));
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   221
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   222
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   223
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   224
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   225
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   226
    public String getCaption() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   227
        return configuration().getText("doclet.Methods");
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
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
     * {@inheritDoc}
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
    public String[] getSummaryTableHeader(ProgramElementDoc 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
   234
        String[] header = new String[] {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   235
            writer.getModifierTypeHeader(),
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   236
            configuration().getText("doclet.0_and_1",
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   237
                    configuration().getText("doclet.Method"),
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   238
                    configuration().getText("doclet.Description"))
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   239
        };
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   240
        return header;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   243
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   244
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   245
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   246
    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   247
        memberTree.addContent(writer.getMarkerAnchor("method_summary"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   250
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   252
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   253
    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   254
        inheritedTree.addContent(writer.getMarkerAnchor(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
                "methods_inherited_from_class_" +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   256
                configuration().getClassName(cd)));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   260
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   261
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   262
    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   263
        Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   264
                LinkInfoImpl.CONTEXT_MEMBER, cd, false));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   265
        Content label = new StringContent(cd.isClass() ?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   266
            configuration().getText("doclet.Methods_Inherited_From_Class") :
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   267
            configuration().getText("doclet.Methods_Inherited_From_Interface"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   268
        Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   269
                label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   270
        labelHeading.addContent(writer.getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   271
        labelHeading.addContent(classLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   272
        inheritedTree.addContent(labelHeading);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   275
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   276
     * {@inheritDoc}
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
    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
        MethodDoc meth = (MethodDoc)member;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   280
        addModifierAndType(meth, meth.returnType(), tdSummaryType);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   283
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   284
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   285
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   286
    protected static void addOverridden(HtmlDocletWriter writer,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   287
            Type overriddenType, MethodDoc method, Content dl) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
        if(writer.configuration.nocomment){
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        ClassDoc holderClassDoc = overriddenType.asClassDoc();
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        if (! (holderClassDoc.isPublic() ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
            Util.isLinkable(holderClassDoc, writer.configuration()))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
            //This is an implementation detail that should not be documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
        if (overriddenType.asClassDoc().isIncluded() && ! method.isIncluded()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
            //The class is included but the method is not.  That means that it
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
            //is not visible so don't document this.
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   302
        Content label = writer.overridesLabel;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
        int context = LinkInfoImpl.CONTEXT_METHOD_OVERRIDES;
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
        if (method != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
            if(overriddenType.asClassDoc().isAbstract() && method.isAbstract()){
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
                //Abstract method is implemented from abstract class,
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
                //not overridden
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   309
                label = writer.specifiedByLabel;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
                context = LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY;
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   312
            Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   313
            dl.addContent(dt);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   314
            Content overriddenTypeLink = new RawHtml(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   315
                    writer.getLink(new LinkInfoImpl(context, overriddenType)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   316
            Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
            String name = method.name();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   318
            Content methlink = new RawHtml(writer.getLink(
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
                    new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   320
                    overriddenType.asClassDoc(),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   321
                    writer.getAnchor(method), name, false)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   322
            Content codeMethLink = HtmlTree.CODE(methlink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   323
            Content dd = HtmlTree.DD(codeMethLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   324
            dd.addContent(writer.getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
            dd.addContent(writer.getResource("doclet.in_class"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   326
            dd.addContent(writer.getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   327
            dd.addContent(codeOverridenTypeLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   328
            dl.addContent(dd);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
     * Parse the &lt;Code&gt; tag and return the text.
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
    protected String parseCodeTag(String tag){
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
        if(tag == null){
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
            return "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
        String lc = tag.toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
        int begin = lc.indexOf("<code>");
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
        int end = lc.indexOf("</code>");
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
        if(begin == -1 || end == -1 || end <= begin){
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
            return tag;
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
            return tag.substring(begin + 6, end);
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   350
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   351
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   352
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   353
    protected static void addImplementsInfo(HtmlDocletWriter writer,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   354
            MethodDoc method, Content dl) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
        if(writer.configuration.nocomment){
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
        ImplementedMethods implementedMethodsFinder =
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   359
                new ImplementedMethods(method, writer.configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
        MethodDoc[] implementedMethods = implementedMethodsFinder.build();
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
        for (int i = 0; i < implementedMethods.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
            MethodDoc implementedMeth = implementedMethods[i];
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
            Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   364
            Content intfaclink = new RawHtml(writer.getLink(new LinkInfoImpl(
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
                    LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY, intfac)));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   366
            Content codeIntfacLink = HtmlTree.CODE(intfaclink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   367
            Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   368
            dl.addContent(dt);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   369
            Content methlink = new RawHtml(writer.getDocLink(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   370
                    LinkInfoImpl.CONTEXT_MEMBER, implementedMeth,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   371
                    implementedMeth.name(), false));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   372
            Content codeMethLink = HtmlTree.CODE(methlink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   373
            Content dd = HtmlTree.DD(codeMethLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   374
            dd.addContent(writer.getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   375
            dd.addContent(writer.getResource("doclet.in_interface"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   376
            dd.addContent(writer.getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   377
            dd.addContent(codeIntfacLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   378
            dl.addContent(dd);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   382
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   383
     * Add the return type.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   384
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   385
     * @param method the method being documented.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   386
     * @param htmltree the content tree to which the return type will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   387
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   388
    protected void addReturnType(MethodDoc method, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   389
        Type type = method.returnType();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   390
        if (type != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   391
            Content linkContent = new RawHtml(writer.getLink(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   392
                    new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE, type)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   393
            htmltree.addContent(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   394
            htmltree.addContent(writer.getSpace());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   398
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   399
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   400
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   401
    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
        if (link) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   403
            return writer.getHyperLink("", (cd == null)?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   404
                "method_summary":
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   405
                "methods_inherited_from_class_" +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   406
                configuration().getClassName(cd),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   407
                writer.getResource("doclet.navMethod"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   409
            return writer.getResource("doclet.navMethod");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   410
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   411
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   412
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   413
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   414
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   415
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   416
    protected void addNavDetailLink(boolean link, Content liNav) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   417
        if (link) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   418
            liNav.addContent(writer.getHyperLink("", "method_detail",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   419
                    writer.getResource("doclet.navMethod")));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   420
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   421
            liNav.addContent(writer.getResource("doclet.navMethod"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
}