author | pmuthuswamy |
Tue, 23 Apr 2019 18:28:48 +0530 | |
changeset 54596 | 86c1da00dd6a |
parent 54350 | 4f9772f4403d |
child 54610 | a9ab154b1384 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
53863
d001808c57e8
8218998: Add metadata to generated API documentation files
jjg
parents:
53562
diff
changeset
|
2 |
* Copyright (c) 2003, 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 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
28 |
import java.util.List; |
14265
4e8e488eeae0
8000666: javadoc should write directly to Writer instead of composing strings
jjg
parents:
14260
diff
changeset
|
29 |
|
44196
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
30 |
import javax.lang.model.element.ModuleElement; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
31 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
32 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
33 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
34 |
import com.sun.source.doctree.DocTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
36 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper; |
40587 | 44 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
10 | 45 |
|
46 |
/** |
|
47 |
* Generate the Class Information Page. |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
48 |
* |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
49 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
50 |
* 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:
14258
diff
changeset
|
51 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
52 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
53 |
* |
10 | 54 |
* @see java.util.Collections |
55 |
* @see java.util.List |
|
56 |
* @see java.util.ArrayList |
|
57 |
* @see java.util.HashMap |
|
58 |
* |
|
59 |
* @author Atul M Dambalkar |
|
60 |
* @author Robert Field |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
61 |
* @author Bhavesh Patel (Modified) |
10 | 62 |
*/ |
63 |
public class AnnotationTypeWriterImpl extends SubWriterHolderWriter |
|
64 |
implements AnnotationTypeWriter { |
|
65 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
66 |
protected TypeElement annotationType; |
10 | 67 |
|
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
68 |
private final Navigation navBar; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
69 |
|
10 | 70 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
71 |
* @param configuration the configuration |
10 | 72 |
* @param annotationType the annotation type being documented. |
73 |
*/ |
|
45417 | 74 |
public AnnotationTypeWriterImpl(HtmlConfiguration configuration, |
48756
ce608a09a666
8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents:
48654
diff
changeset
|
75 |
TypeElement annotationType) { |
48759
ffa68af7da87
8195795: Organize output files by module/package, not just package
jjg
parents:
48756
diff
changeset
|
76 |
super(configuration, configuration.docPaths.forClass(annotationType)); |
10 | 77 |
this.annotationType = annotationType; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
78 |
configuration.currentTypeElement = annotationType; |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
79 |
this.navBar = new Navigation(annotationType, configuration, fixedNavDiv, PageMode.CLASS, path); |
10 | 80 |
} |
81 |
||
82 |
/** |
|
83 |
* {@inheritDoc} |
|
84 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
85 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
86 |
public Content getHeader(String header) { |
54350
4f9772f4403d
8215599: Remove support for javadoc "frames" mode
pmuthuswamy
parents:
54060
diff
changeset
|
87 |
HtmlTree bodyTree = getBody(getWindowTitle(utils.getSimpleName(annotationType))); |
53562 | 88 |
HtmlTree htmlTree = HtmlTree.HEADER(); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
89 |
addTop(htmlTree); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
90 |
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(annotationType), |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
91 |
contents.moduleLabel); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
92 |
navBar.setNavLinkModule(linkContent); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
93 |
navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
94 |
navBar.setUserHeader(getUserHeaderFooter(true)); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
95 |
htmlTree.add(navBar.getContent(true)); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
96 |
bodyTree.add(htmlTree); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
97 |
bodyTree.add(MarkerComments.START_OF_CLASS_DATA); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
98 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
47846 | 99 |
div.setStyle(HtmlStyle.header); |
44196
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
100 |
if (configuration.showModules) { |
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
101 |
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType); |
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
102 |
Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel); |
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
103 |
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typeModuleLabel); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
104 |
moduleNameDiv.add(Contents.SPACE); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
105 |
moduleNameDiv.add(getModuleLink(mdle, new StringContent(mdle.getQualifiedName()))); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
106 |
div.add(moduleNameDiv); |
44196
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
107 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
108 |
PackageElement pkg = utils.containingPackage(annotationType); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
109 |
if (!pkg.isUnnamed()) { |
44196
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
110 |
Content typePackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel); |
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
111 |
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typePackageLabel); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
112 |
pkgNameDiv.add(Contents.SPACE); |
44196
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42816
diff
changeset
|
113 |
Content pkgNameContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
114 |
pkgNameDiv.add(pkgNameContent); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
115 |
div.add(pkgNameDiv); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
} |
14542 | 117 |
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
17561 | 118 |
LinkInfoImpl.Kind.CLASS_HEADER, annotationType); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
119 |
Content headerContent = new StringContent(header); |
53991 | 120 |
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
|
121 |
HtmlStyle.title, headerContent); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
122 |
heading.add(getTypeParameterLinks(linkInfo)); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
123 |
div.add(heading); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
124 |
mainTree.add(div); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
125 |
return bodyTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
126 |
} |
10 | 127 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
128 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
129 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
130 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
131 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
132 |
public Content getAnnotationContentHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
133 |
return getContentHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
134 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
135 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
136 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
137 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
138 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
139 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
140 |
public void addFooter(Content contentTree) { |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
141 |
contentTree.add(MarkerComments.END_OF_CLASS_DATA); |
53562 | 142 |
Content htmlTree = HtmlTree.FOOTER(); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
143 |
navBar.setUserFooter(getUserHeaderFooter(false)); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
144 |
htmlTree.add(navBar.getContent(false)); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
145 |
addBottom(htmlTree); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
146 |
contentTree.add(htmlTree); |
10 | 147 |
} |
148 |
||
149 |
/** |
|
150 |
* {@inheritDoc} |
|
151 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
152 |
@Override |
40587 | 153 |
public void printDocument(Content contentTree) throws DocFileIOException { |
53863
d001808c57e8
8218998: Add metadata to generated API documentation files
jjg
parents:
53562
diff
changeset
|
154 |
String description = getDescription("declaration", annotationType); |
53866
880baf6db17b
8213354: Support package-specific stylesheets
pmuthuswamy
parents:
53863
diff
changeset
|
155 |
PackageElement pkg = utils.containingPackage(this.annotationType); |
880baf6db17b
8213354: Support package-specific stylesheets
pmuthuswamy
parents:
53863
diff
changeset
|
156 |
Content stylesheetContent = getLocalStylesheetContent(pkg); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
157 |
printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType), |
53880
3f1e9372557f
8219497: Unused parameter in HtmlDocletWriter::printHtmlDocument
jjg
parents:
53879
diff
changeset
|
158 |
description, stylesheetContent, contentTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
159 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
160 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
161 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
162 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
164 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
165 |
public Content getAnnotationInfoTreeHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
166 |
return getMemberTreeHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
168 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
169 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
170 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
171 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
172 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
173 |
public Content getAnnotationInfo(Content annotationInfoTree) { |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54350
diff
changeset
|
174 |
return HtmlTree.SECTION(HtmlStyle.description, annotationInfoTree); |
10 | 175 |
} |
176 |
||
177 |
/** |
|
178 |
* {@inheritDoc} |
|
179 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
180 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
181 |
public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) { |
47272 | 182 |
Content hr = new HtmlTree(HtmlTag.HR); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
183 |
annotationInfoTree.add(hr); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
184 |
Content pre = new HtmlTree(HtmlTag.PRE); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
185 |
addAnnotationInfo(annotationType, pre); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
186 |
pre.add(modifiers); |
14542 | 187 |
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
17561 | 188 |
LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
189 |
Content annotationName = new StringContent(utils.getSimpleName(annotationType)); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
190 |
Content parameterLinks = getTypeParameterLinks(linkInfo); |
14542 | 191 |
if (configuration.linksource) { |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
9068
diff
changeset
|
192 |
addSrcLink(annotationType, annotationName, pre); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
193 |
pre.add(parameterLinks); |
10 | 194 |
} else { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
20237
diff
changeset
|
195 |
Content span = HtmlTree.SPAN(HtmlStyle.memberNameLabel, annotationName); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
196 |
span.add(parameterLinks); |
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
197 |
pre.add(span); |
10 | 198 |
} |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
199 |
annotationInfoTree.add(pre); |
10 | 200 |
} |
201 |
||
202 |
/** |
|
203 |
* {@inheritDoc} |
|
204 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
205 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
206 |
public void addAnnotationTypeDescription(Content annotationInfoTree) { |
41452 | 207 |
if (!configuration.nocomment) { |
208 |
if (!utils.getFullBody(annotationType).isEmpty()) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
209 |
addInlineComment(annotationType, annotationInfoTree); |
10 | 210 |
} |
211 |
} |
|
212 |
} |
|
213 |
||
214 |
/** |
|
215 |
* {@inheritDoc} |
|
216 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
217 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
218 |
public void addAnnotationTypeTagInfo(Content annotationInfoTree) { |
41452 | 219 |
if (!configuration.nocomment) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
220 |
addTagsInfo(annotationType, annotationInfoTree); |
10 | 221 |
} |
222 |
} |
|
223 |
||
224 |
/** |
|
225 |
* {@inheritDoc} |
|
226 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
227 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
228 |
public void addAnnotationTypeDeprecationInfo(Content annotationInfoTree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
229 |
List<? extends DocTree> deprs = utils.getBlockTags(annotationType, DocTree.Kind.DEPRECATED); |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
21478
diff
changeset
|
230 |
if (utils.isDeprecated(annotationType)) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
231 |
CommentHelper ch = utils.getCommentHelper(annotationType); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
41452
diff
changeset
|
232 |
Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(annotationType)); |
47272 | 233 |
Content div = HtmlTree.DIV(HtmlStyle.deprecationBlock, deprLabel); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
234 |
if (!deprs.isEmpty()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
235 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
236 |
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
237 |
if (!commentTags.isEmpty()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
238 |
addInlineDeprecatedComment(annotationType, deprs.get(0), div); |
10 | 239 |
} |
240 |
} |
|
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
53991
diff
changeset
|
241 |
annotationInfoTree.add(div); |
10 | 242 |
} |
243 |
} |
|
244 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
245 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
246 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
247 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
248 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
249 |
public TypeElement getAnnotationTypeElement() { |
10 | 250 |
return annotationType; |
251 |
} |
|
252 |
} |