author | ksrini |
Mon, 05 Jun 2017 13:45:34 -0700 | |
changeset 45417 | f7479ee8de69 |
parent 42816 | 3638773ff1b0 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
45417 | 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:
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.ArrayList; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
29 |
import java.util.EnumMap; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
30 |
import java.util.List; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
31 |
import java.util.SortedSet; |
14258 | 32 |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
33 |
import javax.lang.model.element.Element; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
34 |
import javax.lang.model.element.ModuleElement; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
35 |
import javax.lang.model.element.PackageElement; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
36 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
37 |
import com.sun.source.doctree.DocTree; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder; |
40587 | 45 |
import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder.DeprElementKind; |
46 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
48 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
10 | 49 |
|
50 |
/** |
|
51 |
* Generate File to list all the deprecated classes and class members with the |
|
52 |
* appropriate links. |
|
53 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
54 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
55 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
56 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
57 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
58 |
* |
10 | 59 |
* @see java.util.List |
60 |
* @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:
1787
diff
changeset
|
61 |
* @author Bhavesh Patel (Modified) |
10 | 62 |
*/ |
63 |
public class DeprecatedListWriter extends SubWriterHolderWriter { |
|
64 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
65 |
private String getAnchorName(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
66 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
67 |
case REMOVAL: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
68 |
return "forRemoval"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
69 |
case MODULE: |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
70 |
return "module"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
71 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
72 |
return "package"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
73 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
74 |
return "interface"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
75 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
76 |
return "class"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
77 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
78 |
return "enum"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
79 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
80 |
return "exception"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
81 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
82 |
return "error"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
83 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
84 |
return "annotation.type"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
85 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
86 |
return "field"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
87 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
88 |
return "method"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
89 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
90 |
return "constructor"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
91 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
92 |
return "enum.constant"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
93 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
94 |
return "annotation.type.member"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
95 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
96 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
97 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
98 |
} |
10 | 99 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
100 |
private String getHeadingKey(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
101 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
102 |
case REMOVAL: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
103 |
return "doclet.Deprecated_For_Removal"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
104 |
case MODULE: |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
105 |
return "doclet.Deprecated_Modules"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
106 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
107 |
return "doclet.Deprecated_Packages"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
108 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
109 |
return "doclet.Deprecated_Interfaces"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
110 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
111 |
return "doclet.Deprecated_Classes"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
112 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
113 |
return "doclet.Deprecated_Enums"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
114 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
115 |
return "doclet.Deprecated_Exceptions"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
116 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
117 |
return "doclet.Deprecated_Errors"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
118 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
119 |
return "doclet.Deprecated_Annotation_Types"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
120 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
121 |
return "doclet.Deprecated_Fields"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
122 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
123 |
return "doclet.Deprecated_Methods"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
124 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
125 |
return "doclet.Deprecated_Constructors"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
126 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
127 |
return "doclet.Deprecated_Enum_Constants"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
128 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
129 |
return "doclet.Deprecated_Annotation_Type_Members"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
130 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
131 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
132 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
133 |
} |
10 | 134 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
135 |
private String getSummaryKey(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
136 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
137 |
case REMOVAL: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
138 |
return "doclet.deprecated_for_removal"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
139 |
case MODULE: |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
140 |
return "doclet.deprecated_modules"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
141 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
142 |
return "doclet.deprecated_packages"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
143 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
144 |
return "doclet.deprecated_interfaces"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
145 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
146 |
return "doclet.deprecated_classes"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
147 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
148 |
return "doclet.deprecated_enums"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
149 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
150 |
return "doclet.deprecated_exceptions"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
151 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
152 |
return "doclet.deprecated_errors"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
153 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
154 |
return "doclet.deprecated_annotation_types"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
155 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
156 |
return "doclet.deprecated_fields"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
157 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
158 |
return "doclet.deprecated_methods"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
159 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
160 |
return "doclet.deprecated_constructors"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
161 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
162 |
return "doclet.deprecated_enum_constants"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
163 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
164 |
return "doclet.deprecated_annotation_type_members"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
165 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
166 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
167 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
168 |
} |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
169 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
170 |
private String getHeaderKey(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
171 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
172 |
case REMOVAL: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
173 |
return "doclet.Element"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
174 |
case MODULE: |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
175 |
return "doclet.Module"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
176 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
177 |
return "doclet.Package"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
178 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
179 |
return "doclet.Interface"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
180 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
181 |
return "doclet.Class"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
182 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
183 |
return "doclet.Enum"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
184 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
185 |
return "doclet.Exceptions"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
186 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
187 |
return "doclet.Errors"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
188 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
189 |
return "doclet.AnnotationType"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
190 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
191 |
return "doclet.Field"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
192 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
193 |
return "doclet.Method"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
194 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
195 |
return "doclet.Constructor"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
196 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
197 |
return "doclet.Enum_Constant"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
198 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
199 |
return "doclet.Annotation_Type_Member"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
200 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
201 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
202 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
203 |
} |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
204 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
205 |
private EnumMap<DeprElementKind, AbstractMemberWriter> writerMap; |
10 | 206 |
|
45417 | 207 |
private HtmlConfiguration configuration; |
10 | 208 |
|
209 |
/** |
|
210 |
* Constructor. |
|
211 |
* |
|
40587 | 212 |
* @param configuration the configuration for this doclet |
213 |
* @param filename the file to be generated |
|
10 | 214 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
215 |
|
45417 | 216 |
public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) { |
10 | 217 |
super(configuration, filename); |
218 |
this.configuration = configuration; |
|
219 |
NestedClassWriterImpl classW = new NestedClassWriterImpl(this); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
220 |
writerMap = new EnumMap<>(DeprElementKind.class); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
221 |
for (DeprElementKind kind : DeprElementKind.values()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
222 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
223 |
case REMOVAL: |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
224 |
case MODULE: |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
225 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
226 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
227 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
228 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
229 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
230 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
231 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
232 |
writerMap.put(kind, classW); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
233 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
234 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
235 |
writerMap.put(kind, new FieldWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
236 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
237 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
238 |
writerMap.put(kind, new MethodWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
239 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
240 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
241 |
writerMap.put(kind, new ConstructorWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
242 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
243 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
244 |
writerMap.put(kind, new EnumConstantWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
245 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
246 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
247 |
writerMap.put(kind, new AnnotationTypeOptionalMemberWriterImpl(this, null)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
248 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
249 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
250 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
251 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
252 |
} |
10 | 253 |
} |
254 |
||
255 |
/** |
|
256 |
* Get list of all the deprecated classes and members in all the Packages |
|
257 |
* specified on the Command Line. |
|
258 |
* Then instantiate DeprecatedListWriter and generate File. |
|
259 |
* |
|
260 |
* @param configuration the current configuration of the doclet. |
|
40587 | 261 |
* @throws DocFileIOException if there is a problem writing the deprecated list |
10 | 262 |
*/ |
45417 | 263 |
public static void generate(HtmlConfiguration configuration) throws DocFileIOException { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
264 |
DocPath filename = DocPaths.DEPRECATED_LIST; |
40587 | 265 |
DeprecatedListWriter depr = new DeprecatedListWriter(configuration, filename); |
266 |
depr.generateDeprecatedListFile( |
|
267 |
new DeprecatedAPIListBuilder(configuration)); |
|
10 | 268 |
} |
269 |
||
270 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
271 |
* Generate the deprecated API list. |
10 | 272 |
* |
273 |
* @param deprapi list of deprecated API built already. |
|
40587 | 274 |
* @throws DocFileIOException if there is a problem writing the deprecated list |
10 | 275 |
*/ |
276 |
protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) |
|
40587 | 277 |
throws DocFileIOException { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
278 |
HtmlTree body = getHeader(); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
279 |
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
280 |
? HtmlTree.MAIN() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
281 |
: body; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
282 |
htmlTree.addContent(getContentsList(deprapi)); |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
283 |
String memberTableSummary; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
284 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
285 |
div.addStyle(HtmlStyle.contentContainer); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
286 |
for (DeprElementKind kind : DeprElementKind.values()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
287 |
if (deprapi.hasDocumentation(kind)) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
288 |
addAnchor(deprapi, kind, div); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
289 |
memberTableSummary |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
290 |
= resources.getText("doclet.Member_Table_Summary", |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
291 |
resources.getText(getHeadingKey(kind)), |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
292 |
resources.getText(getSummaryKey(kind))); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
293 |
List<String> memberTableHeader = new ArrayList<>(); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
294 |
memberTableHeader.add(resources.getText(getHeaderKey(kind))); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
295 |
memberTableHeader.add(resources.getText("doclet.Description")); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
296 |
addDeprecatedAPI(deprapi.getSet(kind), |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
297 |
getHeadingKey(kind), memberTableSummary, memberTableHeader, div); |
10 | 298 |
} |
299 |
} |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
300 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
301 |
htmlTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
302 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
303 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
304 |
body.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
305 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
306 |
htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
307 |
? HtmlTree.FOOTER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
308 |
: body; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
309 |
addNavLinks(false, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
310 |
addBottom(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
311 |
if (configuration.allowTag(HtmlTag.FOOTER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
312 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
313 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
314 |
printHtmlDocument(null, true, body); |
10 | 315 |
} |
316 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
317 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
318 |
* Add the index link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
319 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
320 |
* @param builder the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
321 |
* @param type the type of list being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
322 |
* @param contentTree the content tree to which the index link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
323 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
324 |
private void addIndexLink(DeprecatedAPIListBuilder builder, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
325 |
DeprElementKind kind, Content contentTree) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
326 |
if (builder.hasDocumentation(kind)) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
327 |
Content li = HtmlTree.LI(getHyperLink(getAnchorName(kind), |
40303 | 328 |
contents.getContent(getHeadingKey(kind)))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
329 |
contentTree.addContent(li); |
10 | 330 |
} |
331 |
} |
|
332 |
||
333 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
334 |
* Get the contents list. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
335 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
336 |
* @param deprapi the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
337 |
* @return a content tree for the contents list |
10 | 338 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
339 |
public Content getContentsList(DeprecatedAPIListBuilder deprapi) { |
40303 | 340 |
Content headContent = contents.deprecatedAPI; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
341 |
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
342 |
HtmlStyle.title, headContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
343 |
Content div = HtmlTree.DIV(HtmlStyle.header, heading); |
40303 | 344 |
Content headingContent = contents.contentsHeading; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
345 |
div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
346 |
headingContent)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
347 |
Content ul = new HtmlTree(HtmlTag.UL); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
348 |
for (DeprElementKind kind : DeprElementKind.values()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
349 |
addIndexLink(deprapi, kind, ul); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
350 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
351 |
div.addContent(ul); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
352 |
return div; |
10 | 353 |
} |
354 |
||
355 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
356 |
* Add the anchor. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
357 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
358 |
* @param builder the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
359 |
* @param type the type of list being documented |
14259 | 360 |
* @param htmlTree the content tree to which the anchor will be added |
10 | 361 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
362 |
private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
363 |
if (builder.hasDocumentation(kind)) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
364 |
htmlTree.addContent(getMarkerAnchor(getAnchorName(kind))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
365 |
} |
10 | 366 |
} |
367 |
||
368 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
369 |
* Get the header for the deprecated API Listing. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
370 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
371 |
* @return a content tree for the header |
10 | 372 |
*/ |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
373 |
public HtmlTree getHeader() { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
374 |
String title = configuration.getText("doclet.Window_Deprecated_List"); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
375 |
HtmlTree bodyTree = getBody(true, getWindowTitle(title)); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
376 |
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
377 |
? HtmlTree.HEADER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
378 |
: bodyTree; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
379 |
addTop(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
380 |
addNavLinks(true, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
381 |
if (configuration.allowTag(HtmlTag.HEADER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
382 |
bodyTree.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
383 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
384 |
return bodyTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
385 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
386 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
387 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
388 |
* Get the deprecated label. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
389 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
390 |
* @return a content tree for the deprecated label |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
391 |
*/ |
40587 | 392 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
393 |
protected Content getNavLinkDeprecated() { |
40303 | 394 |
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.deprecatedLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
395 |
return li; |
10 | 396 |
} |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
397 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
398 |
/** |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
399 |
* Add deprecated information to the documentation tree |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
400 |
* |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
401 |
* @param deprList list of deprecated API elements |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
402 |
* @param headingKey the caption for the deprecated table |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
403 |
* @param tableSummary the summary for the deprecated table |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
404 |
* @param tableHeader table headers for the deprecated table |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
405 |
* @param contentTree the content tree to which the deprecated table will be added |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
406 |
*/ |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
407 |
protected void addDeprecatedAPI(SortedSet<Element> deprList, String headingKey, |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
408 |
String tableSummary, List<String> tableHeader, Content contentTree) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
409 |
if (deprList.size() > 0) { |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
410 |
Content caption = getTableCaption(configuration.getContent(headingKey)); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
411 |
Content table = (configuration.isOutputHtml5()) |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
412 |
? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption) |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
413 |
: HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
414 |
table.addContent(getSummaryTableHeader(tableHeader, "col")); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
415 |
Content tbody = new HtmlTree(HtmlTag.TBODY); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
416 |
boolean altColor = true; |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
417 |
for (Element e : deprList) { |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
418 |
HtmlTree thRow; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
419 |
switch (e.getKind()) { |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
420 |
case MODULE: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
421 |
ModuleElement m = (ModuleElement)e; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
422 |
thRow = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
423 |
getModuleLink(m, new StringContent(m.getQualifiedName()))); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
424 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
425 |
case PACKAGE: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
426 |
PackageElement pkg = (PackageElement)e; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
427 |
thRow = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
428 |
getPackageLink(pkg, getPackageName(pkg))); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
429 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
430 |
default: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
431 |
thRow = getDeprecatedLink(e); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
432 |
} |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
433 |
HtmlTree tr = HtmlTree.TR(thRow); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
434 |
HtmlTree tdDesc = new HtmlTree(HtmlTag.TD); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
435 |
tdDesc.addStyle(HtmlStyle.colLast); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
436 |
List<? extends DocTree> tags = utils.getDeprecatedTrees(e); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
437 |
if (!tags.isEmpty()) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
438 |
addInlineDeprecatedComment(e, tags.get(0), tdDesc); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
439 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
440 |
tr.addContent(tdDesc); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
441 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
442 |
altColor = !altColor; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
443 |
tbody.addContent(tr); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
444 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
445 |
table.addContent(tbody); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
446 |
Content li = HtmlTree.LI(HtmlStyle.blockList, table); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
447 |
Content ul = HtmlTree.UL(HtmlStyle.blockList, li); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
448 |
contentTree.addContent(ul); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
449 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
450 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
451 |
|
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
452 |
protected HtmlTree getDeprecatedLink(Element e) { |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
453 |
AbstractMemberWriter writer; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
454 |
switch (e.getKind()) { |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
455 |
case INTERFACE: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
456 |
case CLASS: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
457 |
case ENUM: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
458 |
case ANNOTATION_TYPE: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
459 |
writer = new NestedClassWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
460 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
461 |
case FIELD: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
462 |
writer = new FieldWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
463 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
464 |
case METHOD: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
465 |
writer = new MethodWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
466 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
467 |
case CONSTRUCTOR: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
468 |
writer = new ConstructorWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
469 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
470 |
case ENUM_CONSTANT: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
471 |
writer = new EnumConstantWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
472 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
473 |
default: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
474 |
writer = new AnnotationTypeOptionalMemberWriterImpl(this, null); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
475 |
} |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
476 |
return HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, writer.getDeprecatedLink(e)); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
477 |
} |
10 | 478 |
} |