author | pmuthuswamy |
Wed, 30 Jan 2019 16:39:26 +0530 | |
changeset 53562 | 0d9dee001667 |
parent 52644 | 43efb4ca6d6c |
child 53879 | e7cb0348fa1c |
permissions | -rw-r--r-- |
10 | 1 |
/* |
48432
db09f53aba91
8193671: Default Methods tab under Method Summary includes static methods
ksrini
parents:
47850
diff
changeset
|
2 |
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
47846 | 28 |
import jdk.javadoc.internal.doclets.formats.html.markup.Table; |
29 |
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; |
|
30 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
31 |
import java.util.SortedSet; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
32 |
import java.util.TreeSet; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
33 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
34 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
35 |
import javax.lang.model.element.ExecutableElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
36 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
37 |
import javax.lang.model.type.TypeMirror; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
38 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.toolkit.MethodWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils; |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
48 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable; |
10 | 49 |
|
50 |
/** |
|
51 |
* Writes method documentation in HTML format. |
|
52 |
* |
|
14260 | 53 |
* <p><b>This is NOT part of any supported API. |
54 |
* If you write code that depends on this, you do so at your own risk. |
|
55 |
* This code and its internal interfaces are subject to change or |
|
56 |
* deletion without notice.</b> |
|
57 |
* |
|
10 | 58 |
* @author Robert Field |
59 |
* @author Atul M Dambalkar |
|
60 |
* @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
|
61 |
* @author Bhavesh Patel (Modified) |
10 | 62 |
*/ |
63 |
public class MethodWriterImpl extends AbstractExecutableMemberWriter |
|
64 |
implements MethodWriter, MemberSummaryWriter { |
|
65 |
||
66 |
/** |
|
67 |
* Construct a new MethodWriterImpl. |
|
68 |
* |
|
69 |
* @param writer the writer for the class that the methods belong to. |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
70 |
* @param typeElement the class being documented. |
10 | 71 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
72 |
public MethodWriterImpl(SubWriterHolderWriter writer, TypeElement typeElement) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
73 |
super(writer, typeElement); |
10 | 74 |
} |
75 |
||
76 |
/** |
|
77 |
* Construct a new MethodWriterImpl. |
|
78 |
* |
|
79 |
* @param writer The writer for the class that the methods belong to. |
|
80 |
*/ |
|
81 |
public MethodWriterImpl(SubWriterHolderWriter writer) { |
|
82 |
super(writer); |
|
83 |
} |
|
84 |
||
85 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
86 |
* {@inheritDoc} |
10 | 87 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
88 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
89 |
public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
90 |
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
|
91 |
Content memberTree = writer.getMemberTreeHeader(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
92 |
writer.addSummaryHeader(this, typeElement, memberTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
93 |
return memberTree; |
10 | 94 |
} |
95 |
||
96 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
97 |
* {@inheritDoc} |
10 | 98 |
*/ |
47846 | 99 |
@Override |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
100 |
public void addMemberTree(Content memberSummaryTree, Content memberTree) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
101 |
writer.addMemberTree(memberSummaryTree, memberTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
102 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
103 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
104 |
/** |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
105 |
* {@inheritDoc} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
106 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
107 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
108 |
public Content getMethodDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
109 |
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
|
110 |
Content methodDetailsTree = writer.getMemberTreeHeader(); |
47850 | 111 |
methodDetailsTree.addContent(links.createAnchor(SectionName.METHOD_DETAIL)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
112 |
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, |
40303 | 113 |
contents.methodDetailLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
114 |
methodDetailsTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
115 |
return methodDetailsTree; |
10 | 116 |
} |
117 |
||
118 |
/** |
|
119 |
* {@inheritDoc} |
|
120 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
121 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
122 |
public Content getMethodDocTreeHeader(ExecutableElement method, Content methodDetailsTree) { |
10 | 123 |
String erasureAnchor; |
124 |
if ((erasureAnchor = getErasureAnchor(method)) != null) { |
|
47850 | 125 |
methodDetailsTree.addContent(links.createAnchor((erasureAnchor))); |
10 | 126 |
} |
47850 | 127 |
methodDetailsTree.addContent(links.createAnchor(writer.getAnchor(method))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
128 |
Content methodDocTree = writer.getMemberTreeHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
129 |
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
130 |
heading.addContent(name(method)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
methodDocTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
132 |
return methodDocTree; |
10 | 133 |
} |
134 |
||
135 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
136 |
* Get the signature for the given method. |
10 | 137 |
* |
138 |
* @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
|
139 |
* @return a content object for the signature |
10 | 140 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
141 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
142 |
public Content getSignature(ExecutableElement method) { |
51127
c2e676c2cf7b
8207190: JDK 11 javadoc generates bad code example
pmuthuswamy
parents:
50167
diff
changeset
|
143 |
HtmlTree pre = new HtmlTree(HtmlTag.PRE); |
c2e676c2cf7b
8207190: JDK 11 javadoc generates bad code example
pmuthuswamy
parents:
50167
diff
changeset
|
144 |
pre.setStyle(HtmlStyle.methodSignature); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
145 |
writer.addAnnotationInfo(method, pre); |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
146 |
int annotationLength = pre.charCount(); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
147 |
addModifiers(method, pre); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
148 |
addTypeParameters(method, pre); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
149 |
addReturnType(method, pre); |
14542 | 150 |
if (configuration.linksource) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
151 |
Content methodName = new StringContent(name(method)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
writer.addSrcLink(method, methodName, pre); |
10 | 153 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
154 |
addName(name(method), pre); |
10 | 155 |
} |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
156 |
int indent = pre.charCount() - annotationLength; |
17564
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
17561
diff
changeset
|
157 |
addParameters(method, pre, indent); |
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
17561
diff
changeset
|
158 |
addExceptions(method, pre, indent); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
159 |
return pre; |
10 | 160 |
} |
161 |
||
162 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
* {@inheritDoc} |
10 | 164 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
165 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
166 |
public void addDeprecated(ExecutableElement method, Content methodDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
addDeprecatedInfo(method, methodDocTree); |
10 | 168 |
} |
169 |
||
170 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
171 |
* {@inheritDoc} |
10 | 172 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
173 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
174 |
public void addComments(TypeMirror holderType, ExecutableElement method, Content methodDocTree) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
175 |
TypeElement holder = utils.asTypeElement(holderType); |
41452 | 176 |
if (!utils.getFullBody(method).isEmpty()) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
177 |
if (holder.equals(typeElement) || |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
178 |
!(utils.isPublic(holder) || |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
179 |
utils.isLinkable(holder))) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
180 |
writer.addInlineComment(method, methodDocTree); |
10 | 181 |
} else { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
182 |
Content link = |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
183 |
writer.getDocLink(LinkInfoImpl.Kind.EXECUTABLE_ELEMENT_COPY, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
184 |
holder, method, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
185 |
utils.isIncluded(holder) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
186 |
? utils.getSimpleName(holder) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
187 |
: utils.getFullyQualifiedName(holder), |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
188 |
false); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
189 |
Content codelLink = HtmlTree.CODE(link); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
190 |
Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
191 |
utils.isClass(holder) |
40303 | 192 |
? contents.descfrmClassLabel |
193 |
: contents.descfrmInterfaceLabel); |
|
194 |
descfrmLabel.addContent(Contents.SPACE); |
|
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
195 |
descfrmLabel.addContent(codelLink); |
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
196 |
methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
197 |
writer.addInlineComment(method, methodDocTree); |
10 | 198 |
} |
199 |
} |
|
200 |
} |
|
201 |
||
202 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
203 |
* {@inheritDoc} |
10 | 204 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
205 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
206 |
public void addTags(ExecutableElement method, Content methodDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
writer.addTagsInfo(method, methodDocTree); |
10 | 208 |
} |
209 |
||
210 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
211 |
* {@inheritDoc} |
10 | 212 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
213 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
214 |
public Content getMethodDetails(Content methodDetailsTree) { |
53562 | 215 |
return HtmlTree.SECTION(getMemberTree(methodDetailsTree)); |
10 | 216 |
} |
217 |
||
218 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
219 |
* {@inheritDoc} |
10 | 220 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
221 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
222 |
public Content getMethodDoc(Content methodDocTree, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
223 |
boolean isLastContent) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
224 |
return getMemberTree(methodDocTree, isLastContent); |
10 | 225 |
} |
226 |
||
227 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
228 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
229 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
230 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
public void addSummaryLabel(Content memberTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
232 |
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, |
40303 | 233 |
contents.methodSummary); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
234 |
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
|
235 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
236 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
237 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
238 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
239 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
240 |
@Override |
47427 | 241 |
public TableHeader getSummaryTableHeader(Element member) { |
242 |
return new TableHeader(contents.modifierAndTypeLabel, contents.methodLabel, |
|
243 |
contents.descriptionLabel); |
|
10 | 244 |
} |
245 |
||
47846 | 246 |
@Override |
247 |
protected Table createSummaryTable() { |
|
53562 | 248 |
return new Table(HtmlStyle.memberSummary) |
47846 | 249 |
.setHeader(getSummaryTableHeader(typeElement)) |
250 |
.setRowScopeColumn(1) |
|
251 |
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast) |
|
252 |
.setDefaultTab(resources.getText("doclet.All_Methods")) |
|
253 |
.addTab(resources.getText("doclet.Static_Methods"), utils::isStatic) |
|
254 |
.addTab(resources.getText("doclet.Instance_Methods"), e -> !utils.isStatic(e)) |
|
255 |
.addTab(resources.getText("doclet.Abstract_Methods"), utils::isAbstract) |
|
256 |
.addTab(resources.getText("doclet.Concrete_Methods"), |
|
257 |
e -> !utils.isAbstract(e) && !utils.isInterface(e.getEnclosingElement())) |
|
48432
db09f53aba91
8193671: Default Methods tab under Method Summary includes static methods
ksrini
parents:
47850
diff
changeset
|
258 |
.addTab(resources.getText("doclet.Default_Methods"), utils::isDefault) |
47846 | 259 |
.addTab(resources.getText("doclet.Deprecated_Methods"), |
260 |
e -> utils.isDeprecated(e) || utils.isDeprecated(typeElement)) |
|
51260
b7a307084247
8203791: Remove "compatibility" features from Table.java
pmuthuswamy
parents:
51127
diff
changeset
|
261 |
.setTabScript(i -> "show(" + i + ");"); |
47846 | 262 |
} |
263 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
264 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
265 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
266 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
267 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
268 |
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { |
47850 | 269 |
memberTree.addContent(links.createAnchor(SectionName.METHOD_SUMMARY)); |
10 | 270 |
} |
271 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
272 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
273 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
274 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
275 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
276 |
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { |
47850 | 277 |
inheritedTree.addContent(links.createAnchor( |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
278 |
SectionName.METHODS_INHERITANCE, configuration.getClassName(typeElement))); |
10 | 279 |
} |
280 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
281 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
282 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
283 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
284 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
285 |
public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) { |
17560 | 286 |
Content classLink = writer.getPreQualifiedClassLink( |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
287 |
LinkInfoImpl.Kind.MEMBER, typeElement, false); |
47395
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
288 |
Content label; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
289 |
if (configuration.summarizeOverriddenMethods) { |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
290 |
label = new StringContent(utils.isClass(typeElement) |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51260
diff
changeset
|
291 |
? resources.getText("doclet.Methods_Declared_In_Class") |
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51260
diff
changeset
|
292 |
: resources.getText("doclet.Methods_Declared_In_Interface")); |
47395
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
293 |
} else { |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
294 |
label = new StringContent(utils.isClass(typeElement) |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51260
diff
changeset
|
295 |
? resources.getText("doclet.Methods_Inherited_From_Class") |
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51260
diff
changeset
|
296 |
: resources.getText("doclet.Methods_Inherited_From_Interface")); |
47395
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
297 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
298 |
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
|
299 |
label); |
40303 | 300 |
labelHeading.addContent(Contents.SPACE); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
301 |
labelHeading.addContent(classLink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
302 |
inheritedTree.addContent(labelHeading); |
10 | 303 |
} |
304 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
305 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
306 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
307 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
308 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
309 |
protected void addSummaryType(Element member, Content tdSummaryType) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
310 |
ExecutableElement meth = (ExecutableElement)member; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
311 |
addModifierAndType(meth, utils.getReturnType(meth), tdSummaryType); |
10 | 312 |
} |
313 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
314 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
315 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
316 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
317 |
protected static void addOverridden(HtmlDocletWriter writer, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
318 |
TypeMirror overriddenType, ExecutableElement method, Content dl) { |
14542 | 319 |
if (writer.configuration.nocomment) { |
10 | 320 |
return; |
321 |
} |
|
40303 | 322 |
Utils utils = writer.utils; |
323 |
Contents contents = writer.contents; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
324 |
TypeElement holder = utils.getEnclosingTypeElement(method); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
325 |
if (!(utils.isPublic(holder) || |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
326 |
utils.isLinkable(holder))) { |
10 | 327 |
//This is an implementation detail that should not be documented. |
328 |
return; |
|
329 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
330 |
if (utils.isIncluded(holder) && ! utils.isIncluded(method)) { |
10 | 331 |
//The class is included but the method is not. That means that it |
332 |
//is not visible so don't document this. |
|
333 |
return; |
|
334 |
} |
|
40303 | 335 |
Content label = contents.overridesLabel; |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
16964
diff
changeset
|
336 |
LinkInfoImpl.Kind context = LinkInfoImpl.Kind.METHOD_OVERRIDES; |
10 | 337 |
|
338 |
if (method != null) { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
339 |
if (utils.isAbstract(holder) && utils.isAbstract(method)){ |
10 | 340 |
//Abstract method is implemented from abstract class, |
341 |
//not overridden |
|
40303 | 342 |
label = contents.specifiedByLabel; |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
16964
diff
changeset
|
343 |
context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY; |
10 | 344 |
} |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
345 |
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, label)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
346 |
dl.addContent(dt); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
347 |
Content overriddenTypeLink = |
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
348 |
writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
349 |
Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
350 |
Content methlink = writer.getLink( |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
16964
diff
changeset
|
351 |
new LinkInfoImpl(writer.configuration, LinkInfoImpl.Kind.MEMBER, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
352 |
holder) |
47850 | 353 |
.where(writer.links.getName(writer.getAnchor(method))).label(method.getSimpleName())); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
354 |
Content codeMethLink = HtmlTree.CODE(methlink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
355 |
Content dd = HtmlTree.DD(codeMethLink); |
40303 | 356 |
dd.addContent(Contents.SPACE); |
357 |
dd.addContent(writer.contents.inClass); |
|
358 |
dd.addContent(Contents.SPACE); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
359 |
dd.addContent(codeOverridenTypeLink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
360 |
dl.addContent(dd); |
10 | 361 |
} |
362 |
} |
|
363 |
||
364 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
365 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
366 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
367 |
protected static void addImplementsInfo(HtmlDocletWriter writer, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
368 |
ExecutableElement method, Content dl) { |
42417
8e1573096052
8139101: javadoc emits "specified by" clause when class has a method that matches a static interface method
bpatel
parents:
41452
diff
changeset
|
369 |
Utils utils = writer.utils; |
8e1573096052
8139101: javadoc emits "specified by" clause when class has a method that matches a static interface method
bpatel
parents:
41452
diff
changeset
|
370 |
if (utils.isStatic(method) || writer.configuration.nocomment) { |
10 | 371 |
return; |
372 |
} |
|
40303 | 373 |
Contents contents = writer.contents; |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
374 |
VisibleMemberTable vmt = writer.configuration |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
375 |
.getVisibleMemberTable(utils.getEnclosingTypeElement(method)); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
376 |
SortedSet<ExecutableElement> implementedMethods = |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
377 |
new TreeSet<>(utils.makeOverrideUseComparator()); |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
378 |
implementedMethods.addAll(vmt.getImplementedMethods(method)); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
379 |
for (ExecutableElement implementedMeth : implementedMethods) { |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
380 |
TypeMirror intfac = vmt.getImplementedMethodHolder(method, implementedMeth); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
381 |
intfac = utils.getDeclaredType(utils.getEnclosingTypeElement(method), intfac); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
382 |
Content intfaclink = writer.getLink(new LinkInfoImpl( |
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
383 |
writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
384 |
Content codeIntfacLink = HtmlTree.CODE(intfaclink); |
40303 | 385 |
Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, contents.specifiedByLabel)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
386 |
dl.addContent(dt); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
387 |
Content methlink = writer.getDocLink( |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
16964
diff
changeset
|
388 |
LinkInfoImpl.Kind.MEMBER, implementedMeth, |
36500
d31e4986dc8b
8149139: [javadoc] Modify Content to accept CharSequence
ksrini
parents:
35426
diff
changeset
|
389 |
implementedMeth.getSimpleName(), false); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
390 |
Content codeMethLink = HtmlTree.CODE(methlink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
391 |
Content dd = HtmlTree.DD(codeMethLink); |
40303 | 392 |
dd.addContent(Contents.SPACE); |
393 |
dd.addContent(contents.inInterface); |
|
394 |
dd.addContent(Contents.SPACE); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
395 |
dd.addContent(codeIntfacLink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
396 |
dl.addContent(dd); |
10 | 397 |
} |
398 |
} |
|
399 |
||
7614
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 |
* Add the return type. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
402 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
403 |
* @param method the method being documented. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
404 |
* @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
|
405 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
406 |
protected void addReturnType(ExecutableElement method, Content htmltree) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
407 |
TypeMirror type = utils.getReturnType(method); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
408 |
if (type != null) { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
409 |
Content linkContent = writer.getLink( |
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
410 |
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
411 |
htmltree.addContent(linkContent); |
40303 | 412 |
htmltree.addContent(Contents.SPACE); |
10 | 413 |
} |
414 |
} |
|
415 |
} |