author | pmuthuswamy |
Tue, 23 Apr 2019 18:28:48 +0530 | |
changeset 54596 | 86c1da00dd6a |
parent 54060 | 53a95878619f |
child 54610 | a9ab154b1384 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
53991 | 2 |
* Copyright (c) 1997, 2019, 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 |
|
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
28 |
import java.util.Arrays; |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
29 |
import java.util.List; |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1789
diff
changeset
|
30 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
31 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
32 |
import javax.lang.model.element.ExecutableElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
33 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
34 |
|
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
36 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.Table; |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.toolkit.ConstructorWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
46 |
|
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
47 |
import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.CONSTRUCTORS; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
48 |
|
10 | 49 |
|
50 |
/** |
|
51 |
* Writes constructor documentation. |
|
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 |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
60 |
* @author Bhavesh Patel (Modified) |
10 | 61 |
*/ |
62 |
public class ConstructorWriterImpl extends AbstractExecutableMemberWriter |
|
63 |
implements ConstructorWriter, MemberSummaryWriter { |
|
64 |
||
65 |
private boolean foundNonPubConstructor = false; |
|
66 |
||
67 |
/** |
|
68 |
* Construct a new ConstructorWriterImpl. |
|
69 |
* |
|
70 |
* @param writer The writer for the class that the constructors belong to. |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
71 |
* @param typeElement the class being documented. |
10 | 72 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
73 |
public ConstructorWriterImpl(SubWriterHolderWriter writer, TypeElement typeElement) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
74 |
super(writer, typeElement); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
75 |
|
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
76 |
VisibleMemberTable vmt = configuration.getVisibleMemberTable(typeElement); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
77 |
List<? extends Element> constructors = vmt.getVisibleMembers(CONSTRUCTORS); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
78 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
79 |
for (Element constructor : constructors) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
80 |
if (utils.isProtected(constructor) || utils.isPrivate(constructor)) { |
10 | 81 |
setFoundNonPubConstructor(true); |
82 |
} |
|
83 |
} |
|
84 |
} |
|
85 |
||
86 |
/** |
|
87 |
* Construct a new ConstructorWriterImpl. |
|
88 |
* |
|
89 |
* @param writer The writer for the class that the constructors belong to. |
|
90 |
*/ |
|
91 |
public ConstructorWriterImpl(SubWriterHolderWriter writer) { |
|
92 |
super(writer); |
|
93 |
} |
|
94 |
||
95 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
96 |
* {@inheritDoc} |
10 | 97 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
98 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
99 |
public Content getMemberSummaryHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
100 |
Content memberSummaryTree) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
101 |
memberSummaryTree.add(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY); |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
102 |
Content memberTree = new ContentBuilder(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
103 |
writer.addSummaryHeader(this, typeElement, memberTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
104 |
return memberTree; |
10 | 105 |
} |
106 |
||
107 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
108 |
* {@inheritDoc} |
10 | 109 |
*/ |
47846 | 110 |
@Override |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
111 |
public void addMemberTree(Content memberSummaryTree, Content memberTree) { |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
112 |
writer.addMemberTree(HtmlStyle.constructorSummary, memberSummaryTree, memberTree); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
113 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
114 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
115 |
/** |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
116 |
* {@inheritDoc} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
117 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
118 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
119 |
public Content getConstructorDetailsTreeHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
120 |
Content memberDetailsTree) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
121 |
memberDetailsTree.add(MarkerComments.START_OF_CONSTRUCTOR_DETAILS); |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
122 |
Content constructorDetailsTree = new ContentBuilder(); |
53991 | 123 |
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, |
40303 | 124 |
contents.constructorDetailsLabel); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
125 |
constructorDetailsTree.add(heading); |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
126 |
constructorDetailsTree.add(links.createAnchor( |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
127 |
SectionName.CONSTRUCTOR_DETAIL)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
128 |
return constructorDetailsTree; |
10 | 129 |
} |
130 |
||
131 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
132 |
* {@inheritDoc} |
10 | 133 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
134 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
135 |
public Content getConstructorDocTreeHeader(ExecutableElement constructor, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
136 |
Content constructorDetailsTree) { |
10 | 137 |
String erasureAnchor; |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
138 |
Content constructorDocTree = new ContentBuilder(); |
53991 | 139 |
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
140 |
heading.add(name(constructor)); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
141 |
constructorDocTree.add(heading); |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
142 |
if ((erasureAnchor = getErasureAnchor(constructor)) != null) { |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
143 |
constructorDocTree.add(links.createAnchor((erasureAnchor))); |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
144 |
} |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
145 |
constructorDocTree.add(links.createAnchor(writer.getAnchor(constructor))); |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
146 |
return HtmlTree.SECTION(HtmlStyle.detail, constructorDocTree); |
10 | 147 |
} |
148 |
||
149 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
150 |
* {@inheritDoc} |
10 | 151 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
152 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
153 |
public Content getSignature(ExecutableElement constructor) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
154 |
Content pre = new HtmlTree(HtmlTag.PRE); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
155 |
writer.addAnnotationInfo(constructor, pre); |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
156 |
int annotationLength = pre.charCount(); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
157 |
addModifiers(constructor, pre); |
14542 | 158 |
if (configuration.linksource) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
159 |
Content constructorName = new StringContent(name(constructor)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
160 |
writer.addSrcLink(constructor, constructorName, pre); |
10 | 161 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
162 |
addName(name(constructor), pre); |
10 | 163 |
} |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
164 |
int indent = pre.charCount() - annotationLength; |
17564
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
16964
diff
changeset
|
165 |
addParameters(constructor, pre, indent); |
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
16964
diff
changeset
|
166 |
addExceptions(constructor, pre, indent); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
return pre; |
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 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
173 |
@Override |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
174 |
public void addDeprecated(ExecutableElement constructor, Content constructorDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
175 |
addDeprecatedInfo(constructor, constructorDocTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
176 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
177 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
178 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
179 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
180 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
181 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
182 |
public void addComments(ExecutableElement constructor, Content constructorDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
addComment(constructor, constructorDocTree); |
10 | 184 |
} |
185 |
||
186 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
187 |
* {@inheritDoc} |
10 | 188 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
189 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
190 |
public void addTags(ExecutableElement constructor, Content constructorDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
191 |
writer.addTagsInfo(constructor, constructorDocTree); |
10 | 192 |
} |
193 |
||
194 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
195 |
* {@inheritDoc} |
10 | 196 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
197 |
@Override |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
198 |
public Content getConstructorDetails(Content constructorDetailsTreeHeader, Content constructorDetailsTree) { |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
199 |
Content constructorDetails = new ContentBuilder(constructorDetailsTreeHeader, constructorDetailsTree); |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
200 |
return getMemberTree(HtmlTree.SECTION(HtmlStyle.constructorDetails, constructorDetails)); |
10 | 201 |
} |
202 |
||
203 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
204 |
* {@inheritDoc} |
10 | 205 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
206 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
public Content getConstructorDoc(Content constructorDocTree, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
208 |
boolean isLastContent) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
209 |
return getMemberTree(constructorDocTree, isLastContent); |
10 | 210 |
} |
211 |
||
212 |
/** |
|
213 |
* Let the writer know whether a non public constructor was found. |
|
214 |
* |
|
215 |
* @param foundNonPubConstructor true if we found a non public constructor. |
|
216 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
217 |
@Override |
10 | 218 |
public void setFoundNonPubConstructor(boolean foundNonPubConstructor) { |
219 |
this.foundNonPubConstructor = foundNonPubConstructor; |
|
220 |
} |
|
221 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
222 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
223 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
224 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
225 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
public void addSummaryLabel(Content memberTree) { |
53991 | 227 |
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, |
40303 | 228 |
contents.constructorSummaryLabel); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
229 |
memberTree.add(label); |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
230 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
231 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
232 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
233 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
234 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
235 |
@Override |
47427 | 236 |
public TableHeader getSummaryTableHeader(Element member) { |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
237 |
if (foundNonPubConstructor) { |
47427 | 238 |
return new TableHeader(contents.modifierLabel, contents.constructorLabel, |
239 |
contents.descriptionLabel); |
|
240 |
} else { |
|
241 |
return new TableHeader(contents.constructorLabel, contents.descriptionLabel); |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
242 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
243 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
244 |
|
47846 | 245 |
@Override |
246 |
protected Table createSummaryTable() { |
|
247 |
List<HtmlStyle> bodyRowStyles; |
|
248 |
int rowScopeColumn; |
|
249 |
||
250 |
if (foundNonPubConstructor) { |
|
251 |
bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colConstructorName, |
|
252 |
HtmlStyle.colLast); |
|
253 |
rowScopeColumn = 1; |
|
254 |
} else { |
|
255 |
bodyRowStyles = Arrays.asList(HtmlStyle.colConstructorName, HtmlStyle.colLast); |
|
256 |
rowScopeColumn = 0; |
|
257 |
} |
|
258 |
||
53562 | 259 |
return new Table(HtmlStyle.memberSummary) |
47846 | 260 |
.setCaption(contents.constructors) |
261 |
.setHeader(getSummaryTableHeader(typeElement)) |
|
262 |
.setRowScopeColumn(rowScopeColumn) |
|
51260
b7a307084247
8203791: Remove "compatibility" features from Table.java
pmuthuswamy
parents:
49879
diff
changeset
|
263 |
.setColumnStyles(bodyRowStyles); |
47846 | 264 |
} |
265 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
266 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
267 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
268 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
269 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
270 |
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
271 |
memberTree.add(links.createAnchor(SectionName.CONSTRUCTOR_SUMMARY)); |
10 | 272 |
} |
273 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
274 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
275 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
276 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
277 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
278 |
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { |
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) { |
10 | 286 |
} |
287 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
288 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
289 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
290 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
291 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
292 |
protected void addSummaryType(Element member, Content tdSummaryType) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
293 |
if (foundNonPubConstructor) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
294 |
Content code = new HtmlTree(HtmlTag.CODE); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
295 |
if (utils.isProtected(member)) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
296 |
code.add("protected "); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
297 |
} else if (utils.isPrivate(member)) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
298 |
code.add("private "); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
299 |
} else if (utils.isPublic(member)) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
300 |
code.add(Contents.SPACE); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
301 |
} else { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
302 |
code.add( |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51260
diff
changeset
|
303 |
resources.getText("doclet.Package_private")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
304 |
} |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
305 |
tdSummaryType.add(code); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
306 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
307 |
} |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
308 |
|
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
309 |
@Override |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
310 |
public Content getMemberTreeHeader(){ |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
311 |
return writer.getMemberTreeHeader(); |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
312 |
} |
10 | 313 |
} |