langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
author ksrini
Wed, 24 Feb 2016 15:31:36 -0800
changeset 36500 d31e4986dc8b
parent 35426 374342e56a56
child 40303 96a1226aca18
permissions -rw-r--r--
8149139: [javadoc] Modify Content to accept CharSequence Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
     2
 * Copyright (c) 1997, 2016, 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: 1787
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: 1787
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: 1787
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
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: 31751
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    27
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    28
import java.util.List;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    30
import javax.lang.model.element.AnnotationMirror;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    31
import javax.lang.model.element.Element;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    32
import javax.lang.model.element.ElementKind;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    33
import javax.lang.model.element.ExecutableElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    34
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    35
import javax.lang.model.element.VariableElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    36
import javax.lang.model.type.ArrayType;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    37
import javax.lang.model.type.DeclaredType;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    38
import javax.lang.model.type.TypeMirror;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    39
import javax.lang.model.type.TypeVariable;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    40
import javax.lang.model.util.SimpleTypeVisitor9;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    41
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    42
import com.sun.tools.javac.util.DefinedBy;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    43
import com.sun.tools.javac.util.DefinedBy.Api;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    44
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    45
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    46
import jdk.javadoc.internal.doclets.toolkit.Content;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    47
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    48
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    49
import static jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl.Kind.*;
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
 * Print method and constructor info.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    54
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
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: 14259
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: 14259
diff changeset
    57
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
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
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
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 abstract class AbstractExecutableMemberWriter extends AbstractMemberWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    65
    public AbstractExecutableMemberWriter(SubWriterHolderWriter writer, TypeElement typeElement) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    66
        super(writer, typeElement);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    public AbstractExecutableMemberWriter(SubWriterHolderWriter writer) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
        super(writer);
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    74
     * Add the type parameters for the executable member.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     * @param member the member to write type parameters for.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    77
     * @param htmltree the content tree to which the parameters will be added.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    79
    protected void addTypeParameters(ExecutableElement member, Content htmltree) {
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    80
        Content typeParameters = getTypeParameters(member);
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    81
        if (!typeParameters.isEmpty()) {
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    82
            htmltree.addContent(typeParameters);
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    83
            htmltree.addContent(writer.getSpace());
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    84
        }
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    85
    }
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    86
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    87
    /**
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    88
     * Get the type parameters for the executable member.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    89
     *
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    90
     * @param member the member for which to get the type parameters.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    91
     * @return the type parameters.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    92
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    93
    protected Content getTypeParameters(ExecutableElement member) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
    94
        LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, MEMBER_TYPE_PARAMS, member);
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
    95
        return writer.getTypeParameterLinks(linkInfo);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
    }
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
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    99
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   100
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   101
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   102
    protected Content getDeprecatedLink(Element member) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   103
        StringBuilder sb = new StringBuilder();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   104
        sb.append(utils.getFullyQualifiedName(member));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   105
        if (!utils.isConstructor(member)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   106
            sb.append(".");
36500
d31e4986dc8b 8149139: [javadoc] Modify Content to accept CharSequence
ksrini
parents: 35426
diff changeset
   107
            sb.append(member.getSimpleName());
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   108
        }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   109
        sb.append(utils.flatSignature((ExecutableElement) member));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   110
36500
d31e4986dc8b 8149139: [javadoc] Modify Content to accept CharSequence
ksrini
parents: 35426
diff changeset
   111
        return writer.getDocLink(MEMBER, member, sb);
10
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
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   115
     * Add the summary link for the member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   116
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
     * @param context the id of the context where the link will be printed
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   118
     * @param te the classDoc that we should link to
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   119
     * @param member the member being linked to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   120
     * @param tdSummary the content tree to which the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   122
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   123
    protected void addSummaryLink(LinkInfoImpl.Kind context, TypeElement te, Element member,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   124
            Content tdSummary) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   125
        ExecutableElement ee = (ExecutableElement)member;
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 21008
diff changeset
   126
        Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   127
                writer.getDocLink(context, te, ee,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   128
                name(ee), false));
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 21008
diff changeset
   129
        Content code = HtmlTree.CODE(memberLink);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   130
        addParameters(ee, false, code, name(ee).length() - 1);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   131
        tdSummary.addContent(code);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   134
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   135
     * Add the inherited summary link for the member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   136
     *
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   137
     * @param te the type element that we should link to
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   138
     * @param member the member being linked to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   139
     * @param linksTree the content tree to which the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   140
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   141
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   142
    protected void addInheritedSummaryLink(TypeElement te, Element member, Content linksTree) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   143
        linksTree.addContent(writer.getDocLink(MEMBER, te, member, name(member), false));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   146
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   147
     * Add the parameter for the executable member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   148
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   149
     * @param member the member to write parameter for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   150
     * @param param the parameter that needs to be written.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   151
     * @param isVarArg true if this is a link to var arg.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   152
     * @param tree the content tree to which the parameter information will be added.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   153
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   154
    protected void addParam(ExecutableElement member, VariableElement param,
17560
9f6771abbd1a 8011650: reduce use of RawHtml nodes in doclet
jjg
parents: 17559
diff changeset
   155
            boolean isVarArg, Content tree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   156
        Content link = writer.getLink(new LinkInfoImpl(configuration, EXECUTABLE_MEMBER_PARAM,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   157
                param.asType()).varargs(isVarArg));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   158
        tree.addContent(link);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   159
        if(name(param).length() > 0) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   160
            tree.addContent(writer.getSpace());
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   161
            tree.addContent(name(param));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
16964
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   165
    /**
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   166
     * Add the receiver annotations information.
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   167
     *
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   168
     * @param member the member to write receiver annotations for.
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   169
     * @param rcvrType the receiver type.
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   170
     * @param descList list of annotation description.
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   171
     * @param tree the content tree to which the information will be added.
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   172
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   173
    protected void addReceiverAnnotations(ExecutableElement member, TypeMirror rcvrType,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   174
            List<? extends AnnotationMirror> annotationMirrors, Content tree) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   175
        writer.addReceiverAnnotationInfo(member, rcvrType, annotationMirrors, tree);
16964
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   176
        tree.addContent(writer.getSpace());
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   177
        tree.addContent(utils.getTypeName(rcvrType, false));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   178
        LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, RECEIVER_TYPE, rcvrType);
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   179
        tree.addContent(writer.getTypeParameterLinks(linkInfo));
16964
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   180
        tree.addContent(writer.getSpace());
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   181
        tree.addContent("this");
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14542
diff changeset
   182
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14542
diff changeset
   183
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14542
diff changeset
   184
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   185
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   186
     * Add all the parameters for the executable member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   187
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   188
     * @param member the member to write parameters for.
14259
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 7681
diff changeset
   189
     * @param htmltree the content tree to which the parameters information will be added.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   190
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   191
    protected void addParameters(ExecutableElement member, Content htmltree, int indentSize) {
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
   192
        addParameters(member, true, htmltree, indentSize);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   195
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   196
     * Add all the parameters for the executable member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   197
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   198
     * @param member the member to write parameters for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   199
     * @param includeAnnotations true if annotation information needs to be added.
14259
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 7681
diff changeset
   200
     * @param htmltree the content tree to which the parameters information will be added.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   201
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   202
    protected void addParameters(ExecutableElement member,
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
   203
            boolean includeAnnotations, Content htmltree, int indentSize) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   204
        htmltree.addContent("(");
16964
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   205
        String sep = "";
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   206
        List<? extends VariableElement> parameters = member.getParameters();
36500
d31e4986dc8b 8149139: [javadoc] Modify Content to accept CharSequence
ksrini
parents: 35426
diff changeset
   207
        CharSequence indent = makeSpace(indentSize + 1);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   208
        TypeMirror rcvrType = member.getReceiverType();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   209
        if (includeAnnotations && rcvrType != null && utils.isAnnotated(rcvrType)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   210
            List<? extends AnnotationMirror> annotationMirrors = rcvrType.getAnnotationMirrors();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   211
            addReceiverAnnotations(member, rcvrType, annotationMirrors, htmltree);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   212
            sep = "," + DocletConstants.NL + indent;
16964
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   213
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
        int paramstart;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   215
        for (paramstart = 0; paramstart < parameters.size(); paramstart++) {
16964
096de5815398 8005091: javadoc should be able to return the receiver type
bpatel
parents: 15385
diff changeset
   216
            htmltree.addContent(sep);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   217
            VariableElement param = parameters.get(paramstart);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   218
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   219
            if (param.getKind() != ElementKind.INSTANCE_INIT) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
                if (includeAnnotations) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   221
                    boolean foundAnnotations =
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   222
                            writer.addAnnotationInfo(indent.length(),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   223
                            member, param, htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   224
                    if (foundAnnotations) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   225
                        htmltree.addContent(DocletConstants.NL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   226
                        htmltree.addContent(indent);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
                }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   229
                addParam(member, param,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   230
                    (paramstart == parameters.size() - 1) && member.isVarArgs(), htmltree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   235
        for (int i = paramstart + 1; i < parameters.size(); i++) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   236
            htmltree.addContent(",");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   237
            htmltree.addContent(DocletConstants.NL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   238
            htmltree.addContent(indent);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
            if (includeAnnotations) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
                boolean foundAnnotations =
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   241
                        writer.addAnnotationInfo(indent.length(), member, parameters.get(i),
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   242
                        htmltree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
                if (foundAnnotations) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   244
                    htmltree.addContent(DocletConstants.NL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   245
                    htmltree.addContent(indent);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
            }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   248
            addParam(member, parameters.get(i), (i == parameters.size() - 1) && member.isVarArgs(),
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   249
                    htmltree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
        htmltree.addContent(")");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   254
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
     * Add exceptions for the executable member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   256
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   257
     * @param member the member to write exceptions for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   258
     * @param htmltree the content tree to which the exceptions information will be added.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   260
    protected void addExceptions(ExecutableElement member, Content htmltree, int indentSize) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   261
        List<? extends TypeMirror> exceptions = member.getThrownTypes();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   262
        if (!exceptions.isEmpty()) {
36500
d31e4986dc8b 8149139: [javadoc] Modify Content to accept CharSequence
ksrini
parents: 35426
diff changeset
   263
            CharSequence indent = makeSpace(indentSize + 1 - 7);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   264
            htmltree.addContent(DocletConstants.NL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   265
            htmltree.addContent(indent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   266
            htmltree.addContent("throws ");
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents: 17561
diff changeset
   267
            indent = makeSpace(indentSize + 1);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   268
            Content link = writer.getLink(new LinkInfoImpl(configuration, MEMBER, exceptions.get(0)));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   269
            htmltree.addContent(link);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   270
            for(int i = 1; i < exceptions.size(); i++) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   271
                htmltree.addContent(",");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   272
                htmltree.addContent(DocletConstants.NL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   273
                htmltree.addContent(indent);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   274
                Content exceptionLink = writer.getLink(new LinkInfoImpl(configuration, MEMBER,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   275
                        exceptions.get(i)));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   276
                htmltree.addContent(exceptionLink);
10
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
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   281
    protected TypeElement implementsMethodInIntfac(ExecutableElement method,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   282
                                                List<TypeElement> intfacs) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   283
        for (TypeElement intf : intfacs) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   284
            List<ExecutableElement> methods = utils.getMethods(intf);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   285
            if (!methods.isEmpty()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   286
                for (ExecutableElement md : methods) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   287
                    if (name(md).equals(name(method)) &&
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   288
                        md.toString().equals(method.toString())) {
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 21478
diff changeset
   289
                        return intf;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
                    }
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
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
     * For backward compatibility, include an anchor using the erasures of the
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
     * parameters.  NOTE:  We won't need this method anymore after we fix
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
     * see tags so that they use the type instead of the erasure.
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
     *
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   302
     * @param executableElement the ExecutableElement to anchor to.
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   303
     * @return the 1.4.x style anchor for the executable element.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   305
    protected String getErasureAnchor(ExecutableElement executableElement) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   306
        final StringBuilder buf = new StringBuilder(name(executableElement) + "(");
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   307
        List<? extends VariableElement> parameters = executableElement.getParameters();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
        boolean foundTypeVariable = false;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   309
        for (int i = 0; i < parameters.size(); i++) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
            if (i > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
                buf.append(",");
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
            }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   313
            TypeMirror t = parameters.get(i).asType();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   314
            SimpleTypeVisitor9<Boolean, Void> stv = new SimpleTypeVisitor9<Boolean, Void>() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   315
                boolean foundTypeVariable = false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   316
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   317
                @Override @DefinedBy(Api.LANGUAGE_MODEL)
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   318
                public Boolean visitArray(ArrayType t, Void p) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   319
                    visit(t.getComponentType());
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   320
                    buf.append(utils.getDimension(t));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   321
                    return foundTypeVariable;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   322
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   323
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   324
                @Override @DefinedBy(Api.LANGUAGE_MODEL)
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   325
                public Boolean visitTypeVariable(TypeVariable t, Void p) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   326
                    buf.append(utils.asTypeElement(t).getQualifiedName());
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   327
                    foundTypeVariable = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   328
                    return foundTypeVariable;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   329
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   330
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   331
                @Override @DefinedBy(Api.LANGUAGE_MODEL)
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   332
                public Boolean visitDeclared(DeclaredType t, Void p) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   333
                    buf.append(utils.getQualifiedTypeName(t));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   334
                    return foundTypeVariable;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   335
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   336
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   337
                @Override @DefinedBy(Api.LANGUAGE_MODEL)
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   338
                protected Boolean defaultAction(TypeMirror e, Void p) {
36500
d31e4986dc8b 8149139: [javadoc] Modify Content to accept CharSequence
ksrini
parents: 35426
diff changeset
   339
                    buf.append(e);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   340
                    return foundTypeVariable;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   341
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   342
            };
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   343
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   344
            boolean isTypeVariable = stv.visit(t);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   345
            if (!foundTypeVariable) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   346
                foundTypeVariable = isTypeVariable;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 31751
diff changeset
   347
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
        buf.append(")");
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 19253
diff changeset
   350
        return foundTypeVariable ? writer.getName(buf.toString()) : null;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
}