author | erikj |
Tue, 12 Sep 2017 19:03:39 +0200 | |
changeset 47216 | 71c04702a3d5 |
parent 41157 | langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java@b235a429089a |
child 47427 | 251676148c62 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
2 |
* Copyright (c) 2003, 2016, 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:
29957
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
28 |
import java.util.Arrays; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
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:
1787
diff
changeset
|
30 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
31 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
32 |
import javax.lang.model.element.ExecutableElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
33 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
34 |
import javax.lang.model.type.TypeMirror; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
35 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
36 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
44 |
|
10 | 45 |
|
46 |
/** |
|
47 |
* Writes annotation type required member documentation in HTML format. |
|
48 |
* |
|
14260 | 49 |
* <p><b>This is NOT part of any supported API. |
50 |
* If you write code that depends on this, you do so at your own risk. |
|
51 |
* This code and its internal interfaces are subject to change or |
|
52 |
* deletion without notice.</b> |
|
53 |
* |
|
10 | 54 |
* @author Jamie Ho |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
55 |
* @author Bhavesh Patel (Modified) |
10 | 56 |
*/ |
57 |
public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter |
|
58 |
implements AnnotationTypeRequiredMemberWriter, MemberSummaryWriter { |
|
59 |
||
60 |
/** |
|
61 |
* Construct a new AnnotationTypeRequiredMemberWriterImpl. |
|
62 |
* |
|
63 |
* @param writer the writer that will write the output. |
|
64 |
* @param annotationType the AnnotationType that holds this member. |
|
65 |
*/ |
|
66 |
public AnnotationTypeRequiredMemberWriterImpl(SubWriterHolderWriter writer, |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
67 |
TypeElement annotationType) { |
10 | 68 |
super(writer, annotationType); |
69 |
} |
|
70 |
||
71 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
72 |
* {@inheritDoc} |
10 | 73 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
74 |
public Content getMemberSummaryHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
75 |
Content memberSummaryTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
76 |
memberSummaryTree.addContent( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
77 |
HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
78 |
Content memberTree = writer.getMemberTreeHeader(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
79 |
writer.addSummaryHeader(this, typeElement, memberTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
80 |
return memberTree; |
10 | 81 |
} |
82 |
||
83 |
/** |
|
84 |
* {@inheritDoc} |
|
85 |
*/ |
|
20237
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
86 |
public Content getMemberTreeHeader() { |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
87 |
return writer.getMemberTreeHeader(); |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
88 |
} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
89 |
|
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
90 |
/** |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
91 |
* {@inheritDoc} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
92 |
*/ |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
93 |
public void addMemberTree(Content memberSummaryTree, Content memberTree) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
94 |
writer.addMemberTree(memberSummaryTree, memberTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
95 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
96 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
97 |
/** |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
98 |
* {@inheritDoc} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
99 |
*/ |
20237
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
100 |
public void addAnnotationDetailsMarker(Content memberDetails) { |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
101 |
memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS); |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
102 |
} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
103 |
|
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
104 |
/** |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
105 |
* {@inheritDoc} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
106 |
*/ |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40303
diff
changeset
|
107 |
public void addAnnotationDetailsTreeHeader(TypeElement te, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
108 |
Content memberDetailsTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
109 |
if (!writer.printedAnnotationHeading) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
110 |
memberDetailsTree.addContent(writer.getMarkerAnchor( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
111 |
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
112 |
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, |
40303 | 113 |
contents.annotationTypeDetailsLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
114 |
memberDetailsTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
115 |
writer.printedAnnotationHeading = true; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
} |
10 | 117 |
} |
118 |
||
119 |
/** |
|
120 |
* {@inheritDoc} |
|
121 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
122 |
public Content getAnnotationDocTreeHeader(Element member, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
123 |
Content annotationDetailsTree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
124 |
String simpleName = name(member); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
125 |
annotationDetailsTree.addContent(writer.getMarkerAnchor(simpleName + |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
126 |
utils.signature((ExecutableElement) member))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
127 |
Content annotationDocTree = writer.getMemberTreeHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
128 |
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
129 |
heading.addContent(simpleName); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
130 |
annotationDocTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
return annotationDocTree; |
10 | 132 |
} |
133 |
||
134 |
/** |
|
135 |
* {@inheritDoc} |
|
136 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
137 |
public Content getSignature(Element member) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
138 |
Content pre = new HtmlTree(HtmlTag.PRE); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
139 |
writer.addAnnotationInfo(member, pre); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
140 |
addModifiers(member, pre); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
141 |
Content link = |
14542 | 142 |
writer.getLink(new LinkInfoImpl(configuration, |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
143 |
LinkInfoImpl.Kind.MEMBER, getType(member))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
pre.addContent(link); |
40303 | 145 |
pre.addContent(Contents.SPACE); |
14542 | 146 |
if (configuration.linksource) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
147 |
Content memberName = new StringContent(name(member)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
148 |
writer.addSrcLink(member, memberName, pre); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
149 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
150 |
addName(name(member), pre); |
10 | 151 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
return pre; |
10 | 153 |
} |
154 |
||
155 |
/** |
|
156 |
* {@inheritDoc} |
|
157 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
158 |
public void addDeprecated(Element member, Content annotationDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
159 |
addDeprecatedInfo(member, annotationDocTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
160 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
161 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
162 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
164 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
165 |
public void addComments(Element member, Content annotationDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
166 |
addComment(member, annotationDocTree); |
10 | 167 |
} |
168 |
||
169 |
/** |
|
170 |
* {@inheritDoc} |
|
171 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
172 |
public void addTags(Element member, Content annotationDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
173 |
writer.addTagsInfo(member, annotationDocTree); |
10 | 174 |
} |
175 |
||
176 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
177 |
* {@inheritDoc} |
10 | 178 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
179 |
public Content getAnnotationDetails(Content annotationDetailsTree) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
180 |
if (configuration.allowTag(HtmlTag.SECTION)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
181 |
HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
182 |
return htmlTree; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
183 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
184 |
return getMemberTree(annotationDetailsTree); |
10 | 185 |
} |
186 |
||
187 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
188 |
* {@inheritDoc} |
10 | 189 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
190 |
public Content getAnnotationDoc(Content annotationDocTree, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
191 |
boolean isLastContent) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
192 |
return getMemberTree(annotationDocTree, isLastContent); |
10 | 193 |
} |
194 |
||
195 |
/** |
|
196 |
* {@inheritDoc} |
|
197 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
198 |
public void addSummaryLabel(Content memberTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, |
40303 | 200 |
contents.annotateTypeRequiredMemberSummaryLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
201 |
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
|
202 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
203 |
|
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
204 |
/** |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
205 |
* {@inheritDoc} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
206 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
public String getTableSummary() { |
14542 | 208 |
return configuration.getText("doclet.Member_Table_Summary", |
209 |
configuration.getText("doclet.Annotation_Type_Required_Member_Summary"), |
|
210 |
configuration.getText("doclet.annotation_type_required_members")); |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
211 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
212 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
213 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
214 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
215 |
*/ |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17559
diff
changeset
|
216 |
public Content getCaption() { |
40303 | 217 |
return configuration.getContent("doclet.Annotation_Type_Required_Members"); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
218 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
219 |
|
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:
29957
diff
changeset
|
223 |
public List<String> getSummaryTableHeader(Element member) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
224 |
List<String> header = Arrays.asList(writer.getModifierTypeHeader(), |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40508
diff
changeset
|
225 |
resources.getText("doclet.Annotation_Type_Required_Member"), resources.getText("doclet.Description")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
return header; |
10 | 227 |
} |
228 |
||
229 |
/** |
|
230 |
* {@inheritDoc} |
|
231 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
232 |
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
233 |
memberTree.addContent(writer.getMarkerAnchor( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
234 |
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
235 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
236 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
237 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
238 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
239 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
240 |
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { |
10 | 241 |
} |
242 |
||
243 |
/** |
|
244 |
* {@inheritDoc} |
|
245 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
246 |
public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) { |
10 | 247 |
} |
248 |
||
249 |
/** |
|
250 |
* {@inheritDoc} |
|
251 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
252 |
protected void addSummaryLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element member, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
253 |
Content tdSummary) { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
254 |
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
255 |
writer.getDocLink(context, member, name(member), false)); |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
256 |
Content code = HtmlTree.CODE(memberLink); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
257 |
tdSummary.addContent(code); |
10 | 258 |
} |
259 |
||
260 |
/** |
|
261 |
* {@inheritDoc} |
|
262 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
263 |
protected void addInheritedSummaryLink(TypeElement typeElement, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
264 |
Element member, Content linksTree) { |
10 | 265 |
//Not applicable. |
266 |
} |
|
267 |
||
268 |
/** |
|
269 |
* {@inheritDoc} |
|
270 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
271 |
protected void addSummaryType(Element member, Content tdSummaryType) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
272 |
addModifierAndType(member, getType(member), tdSummaryType); |
10 | 273 |
} |
274 |
||
275 |
/** |
|
276 |
* {@inheritDoc} |
|
277 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
278 |
protected Content getDeprecatedLink(Element member) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
279 |
String name = utils.getFullyQualifiedName(member) + "." + member.getSimpleName(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
280 |
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name); |
10 | 281 |
} |
282 |
||
283 |
/** |
|
284 |
* {@inheritDoc} |
|
285 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
286 |
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) { |
10 | 287 |
if (link) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
288 |
return writer.getHyperLink( |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
289 |
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY, |
40303 | 290 |
contents.navAnnotationTypeRequiredMember); |
10 | 291 |
} else { |
40303 | 292 |
return contents.navAnnotationTypeRequiredMember; |
10 | 293 |
} |
294 |
} |
|
295 |
||
296 |
/** |
|
297 |
* {@inheritDoc} |
|
298 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
299 |
protected void addNavDetailLink(boolean link, Content liNav) { |
10 | 300 |
if (link) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
301 |
liNav.addContent(writer.getHyperLink( |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
302 |
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL, |
40303 | 303 |
contents.navAnnotationTypeMember)); |
10 | 304 |
} else { |
40303 | 305 |
liNav.addContent(contents.navAnnotationTypeMember); |
10 | 306 |
} |
307 |
} |
|
308 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
309 |
private TypeMirror getType(Element member) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
310 |
return utils.isExecutableElement(member) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
311 |
? utils.getReturnType((ExecutableElement) member) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
312 |
: member.asType(); |
10 | 313 |
} |
314 |
} |