author | jjg |
Mon, 11 Mar 2019 12:59:45 -0700 | |
changeset 54060 | 53a95878619f |
parent 53991 | 786825220790 |
child 54350 | 4f9772f4403d |
permissions | -rw-r--r-- |
10 | 1 |
/* |
53863
d001808c57e8
8218998: Add metadata to generated API documentation files
jjg
parents:
53562
diff
changeset
|
2 |
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
47846 | 28 |
import jdk.javadoc.internal.doclets.formats.html.markup.Table; |
29 |
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; |
|
30 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
31 |
import java.util.EnumMap; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
32 |
import java.util.List; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
33 |
import java.util.SortedSet; |
14258 | 34 |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
35 |
import javax.lang.model.element.Element; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
36 |
import javax.lang.model.element.ModuleElement; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
37 |
import javax.lang.model.element.PackageElement; |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
38 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
39 |
import com.sun.source.doctree.DocTree; |
47846 | 40 |
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
47850
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
47850
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
48 |
import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder; |
40587 | 49 |
import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder.DeprElementKind; |
50 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
51 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
52 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
10 | 53 |
|
54 |
/** |
|
55 |
* Generate File to list all the deprecated classes and class members with the |
|
56 |
* appropriate links. |
|
57 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
58 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
59 |
* 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
|
60 |
* 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
|
61 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
62 |
* |
10 | 63 |
* @see java.util.List |
64 |
* @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
|
65 |
* @author Bhavesh Patel (Modified) |
10 | 66 |
*/ |
67 |
public class DeprecatedListWriter extends SubWriterHolderWriter { |
|
68 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
69 |
private String getAnchorName(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
70 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
71 |
case REMOVAL: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
72 |
return "forRemoval"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
73 |
case MODULE: |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
74 |
return "module"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
75 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
76 |
return "package"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
77 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
78 |
return "interface"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
79 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
80 |
return "class"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
81 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
82 |
return "enum"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
83 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
84 |
return "exception"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
85 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
86 |
return "error"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
87 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
88 |
return "annotation.type"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
89 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
90 |
return "field"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
91 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
92 |
return "method"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
93 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
94 |
return "constructor"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
95 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
96 |
return "enum.constant"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
97 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
98 |
return "annotation.type.member"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
99 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
100 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
101 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
102 |
} |
10 | 103 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
104 |
private String getHeadingKey(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
105 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
106 |
case REMOVAL: |
47299 | 107 |
return "doclet.For_Removal"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
108 |
case MODULE: |
47299 | 109 |
return "doclet.Modules"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
110 |
case PACKAGE: |
47299 | 111 |
return "doclet.Packages"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
112 |
case INTERFACE: |
47299 | 113 |
return "doclet.Interfaces"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
114 |
case CLASS: |
47299 | 115 |
return "doclet.Classes"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
116 |
case ENUM: |
47299 | 117 |
return "doclet.Enums"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
118 |
case EXCEPTION: |
47299 | 119 |
return "doclet.Exceptions"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
120 |
case ERROR: |
47299 | 121 |
return "doclet.Errors"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
122 |
case ANNOTATION_TYPE: |
47299 | 123 |
return "doclet.Annotation_Types"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
124 |
case FIELD: |
47299 | 125 |
return "doclet.Fields"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
126 |
case METHOD: |
47299 | 127 |
return "doclet.Methods"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
128 |
case CONSTRUCTOR: |
47299 | 129 |
return "doclet.Constructors"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
130 |
case ENUM_CONSTANT: |
47299 | 131 |
return "doclet.Enum_Constants"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
132 |
case ANNOTATION_TYPE_MEMBER: |
47299 | 133 |
return "doclet.Annotation_Type_Members"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
134 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
135 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
136 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
137 |
} |
10 | 138 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
139 |
private String getSummaryKey(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
140 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
141 |
case REMOVAL: |
47299 | 142 |
return "doclet.for_removal"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
143 |
case MODULE: |
47299 | 144 |
return "doclet.modules"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
145 |
case PACKAGE: |
47299 | 146 |
return "doclet.packages"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
147 |
case INTERFACE: |
47299 | 148 |
return "doclet.interfaces"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
149 |
case CLASS: |
47299 | 150 |
return "doclet.classes"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
151 |
case ENUM: |
47299 | 152 |
return "doclet.enums"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
153 |
case EXCEPTION: |
47299 | 154 |
return "doclet.exceptions"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
155 |
case ERROR: |
47299 | 156 |
return "doclet.errors"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
157 |
case ANNOTATION_TYPE: |
47299 | 158 |
return "doclet.annotation_types"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
159 |
case FIELD: |
47299 | 160 |
return "doclet.fields"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
161 |
case METHOD: |
47299 | 162 |
return "doclet.methods"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
163 |
case CONSTRUCTOR: |
47299 | 164 |
return "doclet.constructors"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
165 |
case ENUM_CONSTANT: |
47299 | 166 |
return "doclet.enum_constants"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
167 |
case ANNOTATION_TYPE_MEMBER: |
47299 | 168 |
return "doclet.annotation_type_members"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
169 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
170 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
171 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
172 |
} |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
173 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
174 |
private String getHeaderKey(DeprElementKind kind) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
175 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
176 |
case REMOVAL: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
177 |
return "doclet.Element"; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
178 |
case MODULE: |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
179 |
return "doclet.Module"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
180 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
181 |
return "doclet.Package"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
182 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
183 |
return "doclet.Interface"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
184 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
185 |
return "doclet.Class"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
186 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
187 |
return "doclet.Enum"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
188 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
189 |
return "doclet.Exceptions"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
190 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
191 |
return "doclet.Errors"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
192 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
193 |
return "doclet.AnnotationType"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
194 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
195 |
return "doclet.Field"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
196 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
197 |
return "doclet.Method"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
198 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
199 |
return "doclet.Constructor"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
200 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
201 |
return "doclet.Enum_Constant"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
202 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
203 |
return "doclet.Annotation_Type_Member"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
204 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
205 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
206 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
207 |
} |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
208 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
209 |
private EnumMap<DeprElementKind, AbstractMemberWriter> writerMap; |
10 | 210 |
|
45417 | 211 |
private HtmlConfiguration configuration; |
10 | 212 |
|
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
47850
diff
changeset
|
213 |
private final Navigation navBar; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
47850
diff
changeset
|
214 |
|
10 | 215 |
/** |
216 |
* Constructor. |
|
217 |
* |
|
40587 | 218 |
* @param configuration the configuration for this doclet |
219 |
* @param filename the file to be generated |
|
10 | 220 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
221 |
|
45417 | 222 |
public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) { |
10 | 223 |
super(configuration, filename); |
224 |
this.configuration = configuration; |
|
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
47850
diff
changeset
|
225 |
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.DEPRECATED, path); |
10 | 226 |
NestedClassWriterImpl classW = new NestedClassWriterImpl(this); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
227 |
writerMap = new EnumMap<>(DeprElementKind.class); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
228 |
for (DeprElementKind kind : DeprElementKind.values()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
229 |
switch (kind) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
230 |
case REMOVAL: |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
231 |
case MODULE: |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
232 |
case PACKAGE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
233 |
case INTERFACE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
234 |
case CLASS: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
235 |
case ENUM: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
236 |
case EXCEPTION: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
237 |
case ERROR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
238 |
case ANNOTATION_TYPE: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
239 |
writerMap.put(kind, classW); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
240 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
241 |
case FIELD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
242 |
writerMap.put(kind, new FieldWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
243 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
244 |
case METHOD: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
245 |
writerMap.put(kind, new MethodWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
246 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
247 |
case CONSTRUCTOR: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
248 |
writerMap.put(kind, new ConstructorWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
249 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
250 |
case ENUM_CONSTANT: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
251 |
writerMap.put(kind, new EnumConstantWriterImpl(this)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
252 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
253 |
case ANNOTATION_TYPE_MEMBER: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
254 |
writerMap.put(kind, new AnnotationTypeOptionalMemberWriterImpl(this, null)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
255 |
break; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
256 |
default: |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
257 |
throw new AssertionError("unknown kind: " + kind); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
258 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
259 |
} |
10 | 260 |
} |
261 |
||
262 |
/** |
|
263 |
* Get list of all the deprecated classes and members in all the Packages |
|
264 |
* specified on the Command Line. |
|
265 |
* Then instantiate DeprecatedListWriter and generate File. |
|
266 |
* |
|
267 |
* @param configuration the current configuration of the doclet. |
|
40587 | 268 |
* @throws DocFileIOException if there is a problem writing the deprecated list |
10 | 269 |
*/ |
45417 | 270 |
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
|
271 |
DocPath filename = DocPaths.DEPRECATED_LIST; |
40587 | 272 |
DeprecatedListWriter depr = new DeprecatedListWriter(configuration, filename); |
273 |
depr.generateDeprecatedListFile( |
|
274 |
new DeprecatedAPIListBuilder(configuration)); |
|
10 | 275 |
} |
276 |
||
277 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
278 |
* Generate the deprecated API list. |
10 | 279 |
* |
280 |
* @param deprapi list of deprecated API built already. |
|
40587 | 281 |
* @throws DocFileIOException if there is a problem writing the deprecated list |
10 | 282 |
*/ |
283 |
protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) |
|
40587 | 284 |
throws DocFileIOException { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
285 |
HtmlTree body = getHeader(); |
53562 | 286 |
HtmlTree htmlTree = HtmlTree.MAIN(); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
287 |
htmlTree.add(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
|
288 |
String memberTableSummary; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
289 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
47846 | 290 |
div.setStyle(HtmlStyle.contentContainer); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
291 |
for (DeprElementKind kind : DeprElementKind.values()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
292 |
if (deprapi.hasDocumentation(kind)) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
293 |
addAnchor(deprapi, kind, div); |
47427 | 294 |
memberTableSummary = resources.getText("doclet.Member_Table_Summary", |
295 |
resources.getText(getHeadingKey(kind)), |
|
296 |
resources.getText(getSummaryKey(kind))); |
|
297 |
TableHeader memberTableHeader = new TableHeader( |
|
298 |
contents.getContent(getHeaderKey(kind)), contents.descriptionLabel); |
|
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
299 |
addDeprecatedAPI(deprapi.getSet(kind), |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
300 |
getHeadingKey(kind), memberTableSummary, memberTableHeader, div); |
10 | 301 |
} |
302 |
} |
|
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
303 |
htmlTree.add(div); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
304 |
body.add(htmlTree); |
53562 | 305 |
htmlTree = HtmlTree.FOOTER(); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
47850
diff
changeset
|
306 |
navBar.setUserFooter(getUserHeaderFooter(false)); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
307 |
htmlTree.add(navBar.getContent(false)); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
308 |
addBottom(htmlTree); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
309 |
body.add(htmlTree); |
53863
d001808c57e8
8218998: Add metadata to generated API documentation files
jjg
parents:
53562
diff
changeset
|
310 |
String description = "deprecated elements"; |
53880
3f1e9372557f
8219497: Unused parameter in HtmlDocletWriter::printHtmlDocument
jjg
parents:
53879
diff
changeset
|
311 |
printHtmlDocument(null, description, body); |
10 | 312 |
} |
313 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
314 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
315 |
* Add the index link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
316 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
317 |
* @param builder the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
318 |
* @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
|
319 |
* @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
|
320 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
321 |
private void addIndexLink(DeprecatedAPIListBuilder builder, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
322 |
DeprElementKind kind, Content contentTree) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
323 |
if (builder.hasDocumentation(kind)) { |
47850 | 324 |
Content li = HtmlTree.LI(links.createLink(getAnchorName(kind), |
40303 | 325 |
contents.getContent(getHeadingKey(kind)))); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
326 |
contentTree.add(li); |
10 | 327 |
} |
328 |
} |
|
329 |
||
330 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
331 |
* Get the contents list. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
332 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
333 |
* @param deprapi the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
334 |
* @return a content tree for the contents list |
10 | 335 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
336 |
public Content getContentsList(DeprecatedAPIListBuilder deprapi) { |
40303 | 337 |
Content headContent = contents.deprecatedAPI; |
53991 | 338 |
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
339 |
HtmlStyle.title, headContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
340 |
Content div = HtmlTree.DIV(HtmlStyle.header, heading); |
40303 | 341 |
Content headingContent = contents.contentsHeading; |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
342 |
div.add(HtmlTree.HEADING(Headings.CONTENT_HEADING, true, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
343 |
headingContent)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
344 |
Content ul = new HtmlTree(HtmlTag.UL); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
345 |
for (DeprElementKind kind : DeprElementKind.values()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
346 |
addIndexLink(deprapi, kind, ul); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
347 |
} |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
348 |
div.add(ul); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
349 |
return div; |
10 | 350 |
} |
351 |
||
352 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
353 |
* Add the anchor. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
354 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
355 |
* @param builder the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
356 |
* @param type the type of list being documented |
14259 | 357 |
* @param htmlTree the content tree to which the anchor will be added |
10 | 358 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
359 |
private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
360 |
if (builder.hasDocumentation(kind)) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
361 |
htmlTree.add(links.createAnchor(getAnchorName(kind))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
362 |
} |
10 | 363 |
} |
364 |
||
365 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
366 |
* 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
|
367 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
368 |
* @return a content tree for the header |
10 | 369 |
*/ |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
370 |
public HtmlTree getHeader() { |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
49551
diff
changeset
|
371 |
String title = resources.getText("doclet.Window_Deprecated_List"); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
372 |
HtmlTree bodyTree = getBody(true, getWindowTitle(title)); |
53562 | 373 |
HtmlTree htmlTree = HtmlTree.HEADER(); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
374 |
addTop(htmlTree); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
47850
diff
changeset
|
375 |
navBar.setUserHeader(getUserHeaderFooter(true)); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
376 |
htmlTree.add(navBar.getContent(true)); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
377 |
bodyTree.add(htmlTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
378 |
return bodyTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
379 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
380 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
381 |
/** |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
382 |
* Add deprecated information to the documentation tree |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
383 |
* |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
384 |
* @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
|
385 |
* @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
|
386 |
* @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
|
387 |
* @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
|
388 |
* @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
|
389 |
*/ |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
390 |
protected void addDeprecatedAPI(SortedSet<Element> deprList, String headingKey, |
47427 | 391 |
String tableSummary, TableHeader tableHeader, Content contentTree) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
392 |
if (deprList.size() > 0) { |
47846 | 393 |
Content caption = contents.getContent(headingKey); |
53562 | 394 |
Table table = new Table(HtmlStyle.deprecatedSummary) |
47846 | 395 |
.setCaption(caption) |
396 |
.setHeader(tableHeader) |
|
397 |
.setColumnStyles(HtmlStyle.colDeprecatedItemName, HtmlStyle.colLast); |
|
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
398 |
for (Element e : deprList) { |
47846 | 399 |
Content link; |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
400 |
switch (e.getKind()) { |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
401 |
case MODULE: |
47846 | 402 |
ModuleElement m = (ModuleElement) e; |
403 |
link = getModuleLink(m, new StringContent(m.getQualifiedName())); |
|
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
404 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
405 |
case PACKAGE: |
47846 | 406 |
PackageElement pkg = (PackageElement) e; |
407 |
link = getPackageLink(pkg, getPackageName(pkg)); |
|
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
408 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
409 |
default: |
47846 | 410 |
link = getDeprecatedLink(e); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
411 |
} |
47846 | 412 |
Content desc = new ContentBuilder(); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
413 |
List<? extends DocTree> tags = utils.getDeprecatedTrees(e); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
414 |
if (!tags.isEmpty()) { |
47846 | 415 |
addInlineDeprecatedComment(e, tags.get(0), desc); |
416 |
} else { |
|
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
417 |
desc.add(HtmlTree.EMPTY); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
418 |
} |
47846 | 419 |
table.addRow(link, desc); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
420 |
} |
47846 | 421 |
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
422 |
Content ul = HtmlTree.UL(HtmlStyle.blockList, li); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
423 |
contentTree.add(ul); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
424 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
425 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
426 |
|
47846 | 427 |
protected Content getDeprecatedLink(Element e) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
428 |
AbstractMemberWriter writer; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
429 |
switch (e.getKind()) { |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
430 |
case INTERFACE: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
431 |
case CLASS: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
432 |
case ENUM: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
433 |
case ANNOTATION_TYPE: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
434 |
writer = new NestedClassWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
435 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
436 |
case FIELD: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
437 |
writer = new FieldWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
438 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
439 |
case METHOD: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
440 |
writer = new MethodWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
441 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
442 |
case CONSTRUCTOR: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
443 |
writer = new ConstructorWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
444 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
445 |
case ENUM_CONSTANT: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
446 |
writer = new EnumConstantWriterImpl(this); |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
447 |
break; |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
448 |
default: |
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
449 |
writer = new AnnotationTypeOptionalMemberWriterImpl(this, null); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
450 |
} |
47846 | 451 |
return writer.getDeprecatedLink(e); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41157
diff
changeset
|
452 |
} |
10 | 453 |
} |