Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java
41159 views
1
/*
2
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
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
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
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
*
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.
24
*/
25
26
package jdk.javadoc.doclet;
27
28
import java.util.Locale;
29
import java.util.List;
30
import java.util.Set;
31
32
import javax.lang.model.element.Element;
33
import javax.lang.model.SourceVersion;
34
35
import jdk.javadoc.internal.doclets.formats.html.HtmlDoclet;
36
37
/**
38
* This doclet generates HTML-formatted documentation for the specified modules,
39
* packages and types.
40
*
41
* <h2><a id="user-defined-taglets">User-Defined Taglets</a></h2>
42
*
43
* The standard doclet supports user-defined {@link Taglet taglets},
44
* which can be used to generate customized output for user-defined tags
45
* in documentation comments.
46
*
47
* Taglets invoked by the standard doclet must return strings from
48
* {@link Taglet#toString(List,Element) Taglet.toString} as follows:
49
*
50
* <dl>
51
* <dt> <i>Inline Tags</i>
52
* <dd> The returned string must be
53
* <a href="https://www.w3.org/TR/html52/dom.html#flow-content">flow content</a>,
54
* or any valid fragment of HTML code that may appear in the body of a document.
55
* There may be additional constraints, depending on how the tag is to be
56
* used in a documentation comment: for example, if the tag may be used
57
* within an inline element such as {@code <b>} or {@code <i>}, the taglet
58
* must not return a string containing block tags, like {@code <h3>} or
59
* {@code <p>}.
60
* <dt> <i>Block Tags</i>
61
* <dd> The returned string must be suitable content for a definition list,
62
* or {@code <dl>} element. It will typically be a series of pairs
63
* of {@code <dt>} and {@code <dd>} elements.
64
* </dl>
65
*
66
* @see <a href="{@docRoot}/../specs/javadoc/doc-comment-spec.html">
67
* Documentation Comment Specification for the Standard Doclet</a>
68
*/
69
public class StandardDoclet implements Doclet {
70
71
private final HtmlDoclet htmlDoclet;
72
73
/**
74
* Creates an instance of the standard doclet, used to generate HTML-formatted
75
* documentation.
76
*/
77
public StandardDoclet() {
78
htmlDoclet = new HtmlDoclet(this);
79
}
80
81
@Override
82
public void init(Locale locale, Reporter reporter) {
83
htmlDoclet.init(locale, reporter);
84
}
85
86
@Override
87
public String getName() {
88
return "Standard";
89
}
90
91
@Override
92
public Set<? extends Doclet.Option> getSupportedOptions() {
93
return htmlDoclet.getSupportedOptions();
94
}
95
96
@Override
97
public SourceVersion getSupportedSourceVersion() {
98
return htmlDoclet.getSupportedSourceVersion();
99
}
100
101
@Override
102
public boolean run(DocletEnvironment docEnv) {
103
return htmlDoclet.run(docEnv);
104
}
105
106
/**
107
* {@return the locale for this doclet}
108
*
109
* @see #init(Locale, Reporter)
110
*
111
* @since 17
112
*/
113
public Locale getLocale() {
114
return htmlDoclet.getConfiguration().getLocale();
115
}
116
117
/**
118
* {@return the reporter for this doclet}
119
*
120
* @see #init(Locale, Reporter)
121
*
122
* @since 17
123
*/
124
public Reporter getReporter() {
125
return htmlDoclet.getConfiguration().getReporter();
126
}
127
}
128
129