author | jjg |
Fri, 20 Oct 2017 11:08:18 -0700 | |
changeset 47427 | 251676148c62 |
parent 47216 | 71c04702a3d5 |
child 47846 | 4e78aba768f0 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
44460 | 2 |
* Copyright (c) 1997, 2017, 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 |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1789
diff
changeset
|
28 |
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
|
29 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
30 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
31 |
import javax.lang.model.element.ExecutableElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
32 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
33 |
|
47427 | 34 |
import jdk.javadoc.internal.doclets.formats.html.TableHeader; |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40303
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
36 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
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; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
45 |
|
10 | 46 |
|
47 |
/** |
|
48 |
* Writes constructor documentation. |
|
49 |
* |
|
14260 | 50 |
* <p><b>This is NOT part of any supported API. |
51 |
* If you write code that depends on this, you do so at your own risk. |
|
52 |
* This code and its internal interfaces are subject to change or |
|
53 |
* deletion without notice.</b> |
|
54 |
* |
|
10 | 55 |
* @author Robert Field |
56 |
* @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
|
57 |
* @author Bhavesh Patel (Modified) |
10 | 58 |
*/ |
59 |
public class ConstructorWriterImpl extends AbstractExecutableMemberWriter |
|
60 |
implements ConstructorWriter, MemberSummaryWriter { |
|
61 |
||
62 |
private boolean foundNonPubConstructor = false; |
|
63 |
||
64 |
/** |
|
65 |
* Construct a new ConstructorWriterImpl. |
|
66 |
* |
|
67 |
* @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
|
68 |
* @param typeElement the class being documented. |
10 | 69 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
70 |
public ConstructorWriterImpl(SubWriterHolderWriter writer, TypeElement typeElement) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
71 |
super(writer, typeElement); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
72 |
|
44460 | 73 |
VisibleMemberMap visibleMemberMap = configuration.getVisibleMemberMap( |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
74 |
typeElement, |
44460 | 75 |
VisibleMemberMap.Kind.CONSTRUCTORS); |
42000
8b7412f7eecd
8167967: javadoc should identify the ordinal value of enum constants
ksrini
parents:
41157
diff
changeset
|
76 |
List<Element> constructors = visibleMemberMap.getMembers(typeElement); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
77 |
for (Element constructor : constructors) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
78 |
if (utils.isProtected(constructor) || utils.isPrivate(constructor)) { |
10 | 79 |
setFoundNonPubConstructor(true); |
80 |
} |
|
81 |
} |
|
82 |
} |
|
83 |
||
84 |
/** |
|
85 |
* Construct a new ConstructorWriterImpl. |
|
86 |
* |
|
87 |
* @param writer The writer for the class that the constructors belong to. |
|
88 |
*/ |
|
89 |
public ConstructorWriterImpl(SubWriterHolderWriter writer) { |
|
90 |
super(writer); |
|
91 |
} |
|
92 |
||
93 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
94 |
* {@inheritDoc} |
10 | 95 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
96 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
97 |
public Content getMemberSummaryHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
98 |
Content memberSummaryTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
99 |
memberSummaryTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_SUMMARY); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
100 |
Content memberTree = writer.getMemberTreeHeader(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
101 |
writer.addSummaryHeader(this, typeElement, memberTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
102 |
return memberTree; |
10 | 103 |
} |
104 |
||
105 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
106 |
* {@inheritDoc} |
10 | 107 |
*/ |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
108 |
public void addMemberTree(Content memberSummaryTree, Content memberTree) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
109 |
writer.addMemberTree(memberSummaryTree, memberTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
110 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
111 |
|
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 |
* {@inheritDoc} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
114 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
115 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
116 |
public Content getConstructorDetailsTreeHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
117 |
Content memberDetailsTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
118 |
memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
119 |
Content constructorDetailsTree = writer.getMemberTreeHeader(); |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
120 |
constructorDetailsTree.addContent(writer.getMarkerAnchor( |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
121 |
SectionName.CONSTRUCTOR_DETAIL)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
122 |
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, |
40303 | 123 |
contents.constructorDetailsLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
124 |
constructorDetailsTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
125 |
return constructorDetailsTree; |
10 | 126 |
} |
127 |
||
128 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
129 |
* {@inheritDoc} |
10 | 130 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
131 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
132 |
public Content getConstructorDocTreeHeader(ExecutableElement constructor, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
133 |
Content constructorDetailsTree) { |
10 | 134 |
String erasureAnchor; |
135 |
if ((erasureAnchor = getErasureAnchor(constructor)) != null) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
136 |
constructorDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor))); |
10 | 137 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
138 |
constructorDetailsTree.addContent( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
139 |
writer.getMarkerAnchor(writer.getAnchor(constructor))); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
140 |
Content constructorDocTree = writer.getMemberTreeHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
141 |
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
142 |
heading.addContent(name(constructor)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
143 |
constructorDocTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
return constructorDocTree; |
10 | 145 |
} |
146 |
||
147 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
148 |
* {@inheritDoc} |
10 | 149 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
150 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
151 |
public Content getSignature(ExecutableElement constructor) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
Content pre = new HtmlTree(HtmlTag.PRE); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
153 |
writer.addAnnotationInfo(constructor, pre); |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
154 |
int annotationLength = pre.charCount(); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
155 |
addModifiers(constructor, pre); |
14542 | 156 |
if (configuration.linksource) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
157 |
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
|
158 |
writer.addSrcLink(constructor, constructorName, pre); |
10 | 159 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
160 |
addName(name(constructor), pre); |
10 | 161 |
} |
31943
72b69ab429c9
8062647: Wrong indentation of arguments of annotated methods
igerasim
parents:
29957
diff
changeset
|
162 |
int indent = pre.charCount() - annotationLength; |
17564
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
16964
diff
changeset
|
163 |
addParameters(constructor, pre, indent); |
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
16964
diff
changeset
|
164 |
addExceptions(constructor, pre, indent); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
165 |
return pre; |
10 | 166 |
} |
167 |
||
168 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
169 |
* {@inheritDoc} |
10 | 170 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
171 |
@Override |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40303
diff
changeset
|
172 |
public void setSummaryColumnStyleAndScope(HtmlTree thTree) { |
44565
41071e253324
8177417: Constructor Summary readability problems in jdk9 javadoc
bpatel
parents:
44460
diff
changeset
|
173 |
thTree.addStyle(HtmlStyle.colConstructorName); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40303
diff
changeset
|
174 |
thTree.addAttr(HtmlAttr.SCOPE, "row"); |
10 | 175 |
} |
176 |
||
177 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
178 |
* {@inheritDoc} |
10 | 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 addDeprecated(ExecutableElement constructor, Content constructorDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
182 |
addDeprecatedInfo(constructor, constructorDocTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
184 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
185 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
186 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
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 addComments(ExecutableElement constructor, Content constructorDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
190 |
addComment(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 |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
197 |
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
|
198 |
writer.addTagsInfo(constructor, constructorDocTree); |
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 getConstructorDetails(Content constructorDetailsTree) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
206 |
if (configuration.allowTag(HtmlTag.SECTION)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
207 |
HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(constructorDetailsTree)); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
208 |
return htmlTree; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
209 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
210 |
return getMemberTree(constructorDetailsTree); |
10 | 211 |
} |
212 |
||
213 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
214 |
* {@inheritDoc} |
10 | 215 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
216 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
217 |
public Content getConstructorDoc(Content constructorDocTree, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
218 |
boolean isLastContent) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
219 |
return getMemberTree(constructorDocTree, isLastContent); |
10 | 220 |
} |
221 |
||
222 |
/** |
|
223 |
* Let the writer know whether a non public constructor was found. |
|
224 |
* |
|
225 |
* @param foundNonPubConstructor true if we found a non public constructor. |
|
226 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
227 |
@Override |
10 | 228 |
public void setFoundNonPubConstructor(boolean foundNonPubConstructor) { |
229 |
this.foundNonPubConstructor = foundNonPubConstructor; |
|
230 |
} |
|
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 |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
236 |
public void addSummaryLabel(Content memberTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
237 |
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, |
40303 | 238 |
contents.constructorSummaryLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
239 |
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
|
240 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
241 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
242 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
243 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
244 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
245 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
246 |
public String getTableSummary() { |
40303 | 247 |
return resources.getText("doclet.Member_Table_Summary", |
248 |
resources.getText("doclet.Constructor_Summary"), |
|
249 |
resources.getText("doclet.constructors")); |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
250 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
251 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
252 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
253 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
254 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
255 |
@Override |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17564
diff
changeset
|
256 |
public Content getCaption() { |
40303 | 257 |
return contents.constructors; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
258 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
259 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
260 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
261 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
262 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
263 |
@Override |
47427 | 264 |
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
|
265 |
if (foundNonPubConstructor) { |
47427 | 266 |
return new TableHeader(contents.modifierLabel, contents.constructorLabel, |
267 |
contents.descriptionLabel); |
|
268 |
} else { |
|
269 |
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
|
270 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
271 |
} |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
274 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
275 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
276 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
277 |
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
278 |
memberTree.addContent(writer.getMarkerAnchor( |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
279 |
SectionName.CONSTRUCTOR_SUMMARY)); |
10 | 280 |
} |
281 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
282 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
283 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
284 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
285 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
286 |
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { |
10 | 287 |
} |
288 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
289 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
290 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
291 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
292 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
293 |
public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) { |
10 | 294 |
} |
295 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
296 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
297 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
298 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
299 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
300 |
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) { |
10 | 301 |
if (link) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
302 |
return writer.getHyperLink(SectionName.CONSTRUCTOR_SUMMARY, |
40303 | 303 |
contents.navConstructor); |
10 | 304 |
} else { |
40303 | 305 |
return contents.navConstructor; |
10 | 306 |
} |
307 |
} |
|
308 |
||
309 |
/** |
|
310 |
* {@inheritDoc} |
|
311 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
312 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
313 |
protected void addNavDetailLink(boolean link, Content liNav) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
314 |
if (link) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
315 |
liNav.addContent(writer.getHyperLink( |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17570
diff
changeset
|
316 |
SectionName.CONSTRUCTOR_DETAIL, |
40303 | 317 |
contents.navConstructor)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
318 |
} else { |
40303 | 319 |
liNav.addContent(contents.navConstructor); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
320 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
321 |
} |
10 | 322 |
|
323 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
324 |
* {@inheritDoc} |
10 | 325 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
326 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
327 |
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
|
328 |
if (foundNonPubConstructor) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
329 |
Content code = new HtmlTree(HtmlTag.CODE); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
330 |
if (utils.isProtected(member)) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
331 |
code.addContent("protected "); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
332 |
} else if (utils.isPrivate(member)) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
333 |
code.addContent("private "); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31943
diff
changeset
|
334 |
} else if (utils.isPublic(member)) { |
40303 | 335 |
code.addContent(Contents.SPACE); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
336 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
337 |
code.addContent( |
14542 | 338 |
configuration.getText("doclet.Package_private")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
339 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
340 |
tdSummaryType.addContent(code); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
341 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
342 |
} |
10 | 343 |
} |