< prev index next >
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java
Print this page
*** 75,84 ****
--- 75,85 ----
* New line to be added to the documentation.
*/
private static final String NEW_LINE = DocletConstants.NL;
private final HtmlConfiguration configuration;
+ private final HtmlOptions options;
private final Messages messages;
private final Resources resources;
private final Utils utils;
private final DocletEnvironment docEnv;
*** 92,101 ****
--- 93,103 ----
private DocPath relativePath = DocPath.empty;
private SourceToHTMLConverter(HtmlConfiguration configuration, DocletEnvironment rd,
DocPath outputdir) {
this.configuration = configuration;
+ this.options = configuration.getOptions();
this.messages = configuration.getMessages();
this.resources = configuration.resources;
this.utils = configuration.utils;
this.docEnv = rd;
this.outputdir = outputdir;
*** 120,143 ****
return;
}
for (ModuleElement mdl : configuration.getSpecifiedModuleElements()) {
// If -nodeprecated option is set and the module is marked as deprecated,
// do not convert the module files to HTML.
! if (!(configuration.nodeprecated && utils.isDeprecated(mdl)))
convertModule(mdl, outputdir);
}
for (PackageElement pkg : configuration.getSpecifiedPackageElements()) {
// If -nodeprecated option is set and the package is marked as deprecated,
// do not convert the package files to HTML.
! if (!(configuration.nodeprecated && utils.isDeprecated(pkg)))
convertPackage(pkg, outputdir);
}
for (TypeElement te : configuration.getSpecifiedTypeElements()) {
// If -nodeprecated option is set and the class is marked as deprecated
// or the containing package is deprecated, do not convert the
// package files to HTML.
! if (!(configuration.nodeprecated &&
(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te)))))
convertClass(te, outputdir);
}
}
--- 122,145 ----
return;
}
for (ModuleElement mdl : configuration.getSpecifiedModuleElements()) {
// If -nodeprecated option is set and the module is marked as deprecated,
// do not convert the module files to HTML.
! if (!(options.noDeprecated && utils.isDeprecated(mdl)))
convertModule(mdl, outputdir);
}
for (PackageElement pkg : configuration.getSpecifiedPackageElements()) {
// If -nodeprecated option is set and the package is marked as deprecated,
// do not convert the package files to HTML.
! if (!(options.noDeprecated && utils.isDeprecated(pkg)))
convertPackage(pkg, outputdir);
}
for (TypeElement te : configuration.getSpecifiedTypeElements()) {
// If -nodeprecated option is set and the class is marked as deprecated
// or the containing package is deprecated, do not convert the
// package files to HTML.
! if (!(options.noDeprecated &&
(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te)))))
convertClass(te, outputdir);
}
}
*** 157,167 ****
for (Element te : utils.getAllClasses(pkg)) {
// If -nodeprecated option is set and the class is marked as deprecated,
// do not convert the package files to HTML. We do not check for
// containing package deprecation since it is already check in
// the calling method above.
! if (!(configuration.nodeprecated && utils.isDeprecated(te)))
convertClass((TypeElement)te, outputdir);
}
}
/**
--- 159,169 ----
for (Element te : utils.getAllClasses(pkg)) {
// If -nodeprecated option is set and the class is marked as deprecated,
// do not convert the package files to HTML. We do not check for
// containing package deprecation since it is already check in
// the calling method above.
! if (!(options.noDeprecated && utils.isDeprecated(te)))
convertClass((TypeElement)te, outputdir);
}
}
/**
*** 177,187 ****
if (mdl == null) {
return;
}
for (Element elem : mdl.getEnclosedElements()) {
if (elem instanceof PackageElement && configuration.docEnv.isIncluded(elem)
! && !(configuration.nodeprecated && utils.isDeprecated(elem))) {
convertPackage((PackageElement) elem, outputdir);
}
}
}
--- 179,189 ----
if (mdl == null) {
return;
}
for (Element elem : mdl.getEnclosedElements()) {
if (elem instanceof PackageElement && configuration.docEnv.isIncluded(elem)
! && !(options.noDeprecated && utils.isDeprecated(elem))) {
convertPackage((PackageElement) elem, outputdir);
}
}
}
*** 234,246 ****
* @param body the documentation content to be written to the file.
* @param path the path for the file.
*/
private void writeToFile(Content body, DocPath path, TypeElement te) throws DocFileIOException {
Head head = new Head(path, configuration.docletVersion, configuration.startTime)
! // .setTimestamp(!configuration.notimestamp) // temporary: compatibility!
.setTitle(resources.getText("doclet.Window_Source_title"))
! // .setCharset(configuration.charset) // temporary: compatibility!
.setDescription(HtmlDocletWriter.getDescription("source", te))
.setGenerator(HtmlDocletWriter.getGenerator(getClass()))
.addDefaultScript(false)
.setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets());
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
--- 236,248 ----
* @param body the documentation content to be written to the file.
* @param path the path for the file.
*/
private void writeToFile(Content body, DocPath path, TypeElement te) throws DocFileIOException {
Head head = new Head(path, configuration.docletVersion, configuration.startTime)
! // .setTimestamp(!options.notimestamp) // temporary: compatibility!
.setTitle(resources.getText("doclet.Window_Source_title"))
! // .setCharset(options.charset) // temporary: compatibility!
.setDescription(HtmlDocletWriter.getDescription("source", te))
.setGenerator(HtmlDocletWriter.getGenerator(getClass()))
.addDefaultScript(false)
.setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets());
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
*** 254,264 ****
* Returns a link to the stylesheet file.
*
* @param head an HtmlTree to which the stylesheet links will be added
*/
public void addStyleSheetProperties(Content head) {
! String filename = configuration.stylesheetfile;
DocPath stylesheet;
if (filename.length() > 0) {
DocFile file = DocFile.createFileForInput(configuration, filename);
stylesheet = DocPath.create(file.getName());
} else {
--- 256,266 ----
* Returns a link to the stylesheet file.
*
* @param head an HtmlTree to which the stylesheet links will be added
*/
public void addStyleSheetProperties(Content head) {
! String filename = options.stylesheetFile;
DocPath stylesheet;
if (filename.length() > 0) {
DocFile file = DocFile.createFileForInput(configuration, filename);
stylesheet = DocPath.create(file.getName());
} else {
*** 269,279 ****
head.add(link);
addStylesheets(head);
}
protected void addStylesheets(Content tree) {
! List<String> stylesheets = configuration.additionalStylesheets;
if (!stylesheets.isEmpty()) {
stylesheets.forEach((ssheet) -> {
DocFile file = DocFile.createFileForInput(configuration, ssheet);
DocPath ssheetPath = DocPath.create(file.getName());
HtmlTree slink = HtmlTree.LINK("stylesheet", "text/css", relativePath.resolve(ssheetPath).getPath(),
--- 271,281 ----
head.add(link);
addStylesheets(head);
}
protected void addStylesheets(Content tree) {
! List<String> stylesheets = options.additionalStylesheets;
if (!stylesheets.isEmpty()) {
stylesheets.forEach((ssheet) -> {
DocFile file = DocFile.createFileForInput(configuration, ssheet);
DocPath ssheetPath = DocPath.create(file.getName());
HtmlTree slink = HtmlTree.LINK("stylesheet", "text/css", relativePath.resolve(ssheetPath).getPath(),
< prev index next >