author | jjg |
Mon, 04 Mar 2019 11:19:34 -0800 | |
changeset 53991 | 786825220790 |
parent 53883 | f41793b5b83f |
child 54060 | 53a95878619f |
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 |
|
47846 | 28 |
import jdk.javadoc.internal.doclets.formats.html.markup.Table; |
29 |
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; |
|
30 |
||
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1789
diff
changeset
|
31 |
import java.util.*; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1789
diff
changeset
|
32 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
33 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
34 |
import javax.lang.model.element.ExecutableElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
35 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
36 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.toolkit.ConstructorWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
45 |
|
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
46 |
import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
47 |
|
10 | 48 |
|
49 |
/** |
|
50 |
* Writes constructor documentation. |
|
51 |
* |
|
14260 | 52 |
* <p><b>This is NOT part of any supported API. |
53 |
* If you write code that depends on this, you do so at your own risk. |
|
54 |
* This code and its internal interfaces are subject to change or |
|
55 |
* deletion without notice.</b> |
|
56 |
* |
|
10 | 57 |
* @author Robert Field |
58 |
* @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
|
59 |
* @author Bhavesh Patel (Modified) |
10 | 60 |
*/ |
61 |
public class ConstructorWriterImpl extends AbstractExecutableMemberWriter |
|
62 |
implements ConstructorWriter, MemberSummaryWriter { |
|
63 |
||
64 |
private boolean foundNonPubConstructor = false; |
|
65 |
||
66 |
/** |
|
67 |
* Construct a new ConstructorWriterImpl. |
|
68 |
* |
|
69 |
* @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
|
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 ConstructorWriterImpl(SubWriterHolderWriter writer, TypeElement typeElement) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
73 |
super(writer, typeElement); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
74 |
|
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
75 |
VisibleMemberTable vmt = configuration.getVisibleMemberTable(typeElement); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
76 |
List<? extends Element> constructors = vmt.getVisibleMembers(CONSTRUCTORS); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
49551
diff
changeset
|
77 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
78 |
for (Element constructor : constructors) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
79 |
if (utils.isProtected(constructor) || utils.isPrivate(constructor)) { |
10 | 80 |
setFoundNonPubConstructor(true); |
81 |
} |
|
82 |
} |
|
83 |
} |
|
84 |
||
85 |
/** |
|
86 |
* Construct a new ConstructorWriterImpl. |
|
87 |
* |
|
88 |
* @param writer The writer for the class that the constructors belong to. |
|
89 |
*/ |
|
90 |
public ConstructorWriterImpl(SubWriterHolderWriter writer) { |
|
91 |
super(writer); |
|
92 |
} |
|
93 |
||
94 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
95 |
* {@inheritDoc} |
10 | 96 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
97 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
98 |
public Content getMemberSummaryHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
99 |
Content memberSummaryTree) { |
53991 | 100 |
memberSummaryTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
101 |
Content memberTree = writer.getMemberTreeHeader(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
102 |
writer.addSummaryHeader(this, typeElement, memberTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
103 |
return memberTree; |
10 | 104 |
} |
105 |
||
106 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
107 |
* {@inheritDoc} |
10 | 108 |
*/ |
47846 | 109 |
@Override |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
110 |
public void addMemberTree(Content memberSummaryTree, Content memberTree) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
111 |
writer.addMemberTree(memberSummaryTree, memberTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
112 |
} |
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 |
* {@inheritDoc} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
116 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
117 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
118 |
public Content getConstructorDetailsTreeHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
119 |
Content memberDetailsTree) { |
53991 | 120 |
memberDetailsTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_DETAILS); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
121 |
Content constructorDetailsTree = writer.getMemberTreeHeader(); |
47850 | 122 |
constructorDetailsTree.addContent(links.createAnchor( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
123 |
SectionName.CONSTRUCTOR_DETAIL)); |
53991 | 124 |
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, |
40303 | 125 |
contents.constructorDetailsLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
126 |
constructorDetailsTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
127 |
return constructorDetailsTree; |
10 | 128 |
} |
129 |
||
130 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
* {@inheritDoc} |
10 | 132 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
133 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
134 |
public Content getConstructorDocTreeHeader(ExecutableElement constructor, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
135 |
Content constructorDetailsTree) { |
10 | 136 |
String erasureAnchor; |
137 |
if ((erasureAnchor = getErasureAnchor(constructor)) != null) { |
|
47850 | 138 |
constructorDetailsTree.addContent(links.createAnchor((erasureAnchor))); |
10 | 139 |
} |
47850 | 140 |
constructorDetailsTree.addContent(links.createAnchor(writer.getAnchor(constructor))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
141 |
Content constructorDocTree = writer.getMemberTreeHeader(); |
53991 | 142 |
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
143 |
heading.addContent(name(constructor)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
constructorDocTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
145 |
return constructorDocTree; |
10 | 146 |
} |
147 |
||
148 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
149 |
* {@inheritDoc} |
10 | 150 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
151 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
152 |
public Content getSignature(ExecutableElement constructor) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
153 |
Content pre = new HtmlTree(HtmlTag.PRE); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
154 |
writer.addAnnotationInfo(constructor, pre); |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
155 |
int annotationLength = pre.charCount(); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
156 |
addModifiers(constructor, pre); |
14542 | 157 |
if (configuration.linksource) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
158 |
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
|
159 |
writer.addSrcLink(constructor, constructorName, pre); |
10 | 160 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
161 |
addName(name(constructor), pre); |
10 | 162 |
} |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
163 |
int indent = pre.charCount() - annotationLength; |
17564
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
16964
diff
changeset
|
164 |
addParameters(constructor, pre, indent); |
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
16964
diff
changeset
|
165 |
addExceptions(constructor, pre, indent); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
166 |
return pre; |
10 | 167 |
} |
168 |
||
169 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
170 |
* {@inheritDoc} |
10 | 171 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
172 |
@Override |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
173 |
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
|
174 |
addDeprecatedInfo(constructor, constructorDocTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
175 |
} |
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 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
179 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
180 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
181 |
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
|
182 |
addComment(constructor, constructorDocTree); |
10 | 183 |
} |
184 |
||
185 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
186 |
* {@inheritDoc} |
10 | 187 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
188 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
189 |
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
|
190 |
writer.addTagsInfo(constructor, constructorDocTree); |
10 | 191 |
} |
192 |
||
193 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
194 |
* {@inheritDoc} |
10 | 195 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
196 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
197 |
public Content getConstructorDetails(Content constructorDetailsTree) { |
53562 | 198 |
return HtmlTree.SECTION(getMemberTree(constructorDetailsTree)); |
10 | 199 |
} |
200 |
||
201 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
* {@inheritDoc} |
10 | 203 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
204 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
205 |
public Content getConstructorDoc(Content constructorDocTree, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
206 |
boolean isLastContent) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
return getMemberTree(constructorDocTree, isLastContent); |
10 | 208 |
} |
209 |
||
210 |
/** |
|
211 |
* Let the writer know whether a non public constructor was found. |
|
212 |
* |
|
213 |
* @param foundNonPubConstructor true if we found a non public constructor. |
|
214 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
215 |
@Override |
10 | 216 |
public void setFoundNonPubConstructor(boolean foundNonPubConstructor) { |
217 |
this.foundNonPubConstructor = foundNonPubConstructor; |
|
218 |
} |
|
219 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
220 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
221 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
222 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
223 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
224 |
public void addSummaryLabel(Content memberTree) { |
53991 | 225 |
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, |
40303 | 226 |
contents.constructorSummaryLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
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
|
228 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
229 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
230 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
232 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
233 |
@Override |
47427 | 234 |
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
|
235 |
if (foundNonPubConstructor) { |
47427 | 236 |
return new TableHeader(contents.modifierLabel, contents.constructorLabel, |
237 |
contents.descriptionLabel); |
|
238 |
} else { |
|
239 |
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
|
240 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
241 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
242 |
|
47846 | 243 |
@Override |
244 |
protected Table createSummaryTable() { |
|
245 |
List<HtmlStyle> bodyRowStyles; |
|
246 |
int rowScopeColumn; |
|
247 |
||
248 |
if (foundNonPubConstructor) { |
|
249 |
bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colConstructorName, |
|
250 |
HtmlStyle.colLast); |
|
251 |
rowScopeColumn = 1; |
|
252 |
} else { |
|
253 |
bodyRowStyles = Arrays.asList(HtmlStyle.colConstructorName, HtmlStyle.colLast); |
|
254 |
rowScopeColumn = 0; |
|
255 |
} |
|
256 |
||
53562 | 257 |
return new Table(HtmlStyle.memberSummary) |
47846 | 258 |
.setCaption(contents.constructors) |
259 |
.setHeader(getSummaryTableHeader(typeElement)) |
|
260 |
.setRowScopeColumn(rowScopeColumn) |
|
51260
b7a307084247
8203791: Remove "compatibility" features from Table.java
pmuthuswamy
parents:
49879
diff
changeset
|
261 |
.setColumnStyles(bodyRowStyles); |
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.CONSTRUCTOR_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) { |
10 | 277 |
} |
278 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
279 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
280 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
281 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
282 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
283 |
public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) { |
10 | 284 |
} |
285 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
286 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
287 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
288 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
289 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
290 |
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
|
291 |
if (foundNonPubConstructor) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
292 |
Content code = new HtmlTree(HtmlTag.CODE); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
293 |
if (utils.isProtected(member)) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
294 |
code.addContent("protected "); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
295 |
} else if (utils.isPrivate(member)) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
296 |
code.addContent("private "); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
297 |
} else if (utils.isPublic(member)) { |
40303 | 298 |
code.addContent(Contents.SPACE); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
299 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
300 |
code.addContent( |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51260
diff
changeset
|
301 |
resources.getText("doclet.Package_private")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
302 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
303 |
tdSummaryType.addContent(code); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
304 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
305 |
} |
10 | 306 |
} |