8237845: Encapsulate doclet options
Reviewed-by: hannesw, prappo
This commit is contained in:
parent
6b4223eec2
commit
08e63539f2
src/jdk.javadoc/share/classes/jdk/javadoc/internal
doclets
formats/html
AbstractMemberWriter.javaAbstractOverviewIndexWriter.javaAllPackagesIndexWriter.javaAnnotationTypeWriterImpl.javaClassUseWriter.javaClassWriterImpl.javaDocFilesHandlerImpl.javaFieldWriterImpl.javaHelpWriter.javaHtmlConfiguration.javaHtmlDoclet.javaHtmlDocletWriter.javaHtmlOptions.javaHtmlSerialFieldWriter.javaIndexRedirectWriter.javaMethodWriterImpl.javaModuleIndexWriter.javaModuleWriterImpl.javaNestedClassWriterImpl.javaPackageIndexWriter.javaPropertyWriterImpl.javaSourceToHTMLConverter.javaTagletWriterImpl.javaTreeWriter.java
markup
toolkit
AbstractDoclet.javaBaseConfiguration.javaBaseOptions.javaMessages.javaPropertyUtils.java
builders
AnnotationTypeFieldBuilder.javaAnnotationTypeRequiredMemberBuilder.javaConstructorBuilder.javaEnumConstantBuilder.javaFieldBuilder.javaMethodBuilder.javaModuleSummaryBuilder.javaPackageSummaryBuilder.javaPropertyBuilder.javaSerializedFormBuilder.java
taglets
util
tool
@ -378,7 +378,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
|
||||
}
|
||||
|
||||
protected void serialWarning(Element e, String key, String a1, String a2) {
|
||||
if (options.serialWarn) {
|
||||
if (options.serialWarn()) {
|
||||
configuration.messages.warning(e, key, a1, a2);
|
||||
}
|
||||
}
|
||||
@ -596,7 +596,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
|
||||
// Name
|
||||
HtmlTree nameSpan = new HtmlTree(HtmlTag.SPAN);
|
||||
nameSpan.setStyle(HtmlStyle.memberName);
|
||||
if (options.linkSource) {
|
||||
if (options.linkSource()) {
|
||||
Content name = new StringContent(name(element));
|
||||
writer.addSrcLink(element, name, nameSpan);
|
||||
} else {
|
||||
|
@ -141,7 +141,7 @@ public abstract class AbstractOverviewIndexWriter extends HtmlDocletWriter {
|
||||
.setFooter(footer)
|
||||
.toContent());
|
||||
printHtmlDocument(
|
||||
configuration.metakeywords.getOverviewMetaKeywords(title, configuration.getOptions().docTitle),
|
||||
configuration.metakeywords.getOverviewMetaKeywords(title, configuration.getOptions().docTitle()),
|
||||
description, body);
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ public abstract class AbstractOverviewIndexWriter extends HtmlDocletWriter {
|
||||
* @param body the document tree to which the title will be added
|
||||
*/
|
||||
protected void addConfigurationTitle(Content body) {
|
||||
String doctitle = configuration.getOptions().docTitle;
|
||||
String doctitle = configuration.getOptions().docTitle();
|
||||
if (!doctitle.isEmpty()) {
|
||||
Content title = new RawHtml(doctitle);
|
||||
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
|
||||
|
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
@ -113,7 +113,7 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
|
||||
.setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel))
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
|
||||
for (PackageElement pkg : configuration.packages) {
|
||||
if (!(configuration.getOptions().noDeprecated && utils.isDeprecated(pkg))) {
|
||||
if (!(options.noDeprecated() && utils.isDeprecated(pkg))) {
|
||||
Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg));
|
||||
Content summaryContent = new ContentBuilder();
|
||||
addSummaryComment(pkg, summaryContent);
|
||||
|
@ -187,7 +187,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType);
|
||||
Content annotationName = new StringContent(utils.getSimpleName(annotationType));
|
||||
Content parameterLinks = getTypeParameterLinks(linkInfo);
|
||||
if (configuration.getOptions().linkSource) {
|
||||
if (options.linkSource()) {
|
||||
addSrcLink(annotationType, annotationName, pre);
|
||||
pre.add(parameterLinks);
|
||||
} else {
|
||||
@ -203,7 +203,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
*/
|
||||
@Override
|
||||
public void addAnnotationTypeDescription(Content annotationInfoTree) {
|
||||
if (!configuration.getOptions().noComment) {
|
||||
if (!options.noComment()) {
|
||||
if (!utils.getFullBody(annotationType).isEmpty()) {
|
||||
addInlineComment(annotationType, annotationInfoTree);
|
||||
}
|
||||
@ -215,7 +215,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
*/
|
||||
@Override
|
||||
public void addAnnotationTypeTagInfo(Content annotationInfoTree) {
|
||||
if (!configuration.getOptions().noComment) {
|
||||
if (!options.noComment()) {
|
||||
addTagsInfo(annotationType, annotationInfoTree);
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
*/
|
||||
public static void generate(HtmlConfiguration configuration, ClassTree classtree) throws DocFileIOException {
|
||||
ClassUseMapper mapper = new ClassUseMapper(configuration, classtree);
|
||||
boolean nodeprecated = configuration.getOptions().noDeprecated;
|
||||
boolean nodeprecated = configuration.getOptions().noDeprecated();
|
||||
Utils utils = configuration.utils;
|
||||
for (TypeElement aClass : configuration.getIncludedTypeElements()) {
|
||||
// If -nodeprecated option is set and the containing package is marked
|
||||
|
@ -228,7 +228,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
linkInfo.linkToSelf = false;
|
||||
Content className = new StringContent(utils.getSimpleName(typeElement));
|
||||
Content parameterLinks = getTypeParameterLinks(linkInfo);
|
||||
if (configuration.getOptions().linkSource) {
|
||||
if (options.linkSource()) {
|
||||
addSrcLink(typeElement, className, pre);
|
||||
pre.add(parameterLinks);
|
||||
} else {
|
||||
@ -299,7 +299,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
*/
|
||||
@Override
|
||||
public void addClassDescription(Content classInfoTree) {
|
||||
if(!configuration.getOptions().noComment) {
|
||||
if (!options.noComment()) {
|
||||
// generate documentation for the class.
|
||||
if (!utils.getFullBody(typeElement).isEmpty()) {
|
||||
addInlineComment(typeElement, classInfoTree);
|
||||
@ -312,7 +312,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
*/
|
||||
@Override
|
||||
public void addClassTagInfo(Content classInfoTree) {
|
||||
if(!configuration.getOptions().noComment) {
|
||||
if (!options.noComment()) {
|
||||
// Print Information about all the tags here
|
||||
addTagsInfo(typeElement, classInfoTree);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ public class DocFilesHandlerImpl implements DocFilesHandler {
|
||||
}
|
||||
}
|
||||
} else if (srcfile.isDirectory()) {
|
||||
if (options.copyDocfileSubdirs
|
||||
if (options.copyDocfileSubdirs()
|
||||
&& !configuration.shouldExcludeDocFileDir(srcfile.getName())) {
|
||||
DocPath dirDocPath = dstDocPath.resolve(srcfile.getName());
|
||||
copyDirectory(srcfile, dirDocPath, first);
|
||||
|
@ -201,7 +201,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
|
||||
Content classLink = writer.getPreQualifiedClassLink(
|
||||
LinkInfoImpl.Kind.MEMBER, typeElement, false);
|
||||
Content label;
|
||||
if (options.summarizeOverriddenMethods) {
|
||||
if (options.summarizeOverriddenMethods()) {
|
||||
label = new StringContent(utils.isClass(typeElement)
|
||||
? resources.getText("doclet.Fields_Declared_In_Class")
|
||||
: resources.getText("doclet.Fields_Declared_In_Interface"));
|
||||
|
@ -132,7 +132,7 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
ul.setStyle(HtmlStyle.blockList);
|
||||
|
||||
// Overview
|
||||
if (options.createOverview) {
|
||||
if (options.createOverview()) {
|
||||
Content overviewHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
|
||||
contents.overviewLabel);
|
||||
htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, overviewHeading);
|
||||
@ -246,7 +246,7 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
|
||||
|
||||
// Class Use
|
||||
if (options.classUse) {
|
||||
if (options.classUse()) {
|
||||
Content useHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
|
||||
contents.getContent("doclet.help.use.head"));
|
||||
htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, useHead);
|
||||
@ -257,7 +257,7 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
}
|
||||
|
||||
// Tree
|
||||
if (options.createTree) {
|
||||
if (options.createTree()) {
|
||||
Content treeHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
|
||||
contents.getContent("doclet.help.tree.head"));
|
||||
htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, treeHead);
|
||||
@ -275,7 +275,7 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
if (!(options.noDeprecatedList || options.noDeprecated)) {
|
||||
if (!(options.noDeprecatedList() || options.noDeprecated())) {
|
||||
Content dHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
|
||||
contents.deprecatedAPI);
|
||||
htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, dHead);
|
||||
@ -288,9 +288,9 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||
}
|
||||
|
||||
// Index
|
||||
if (options.createIndex) {
|
||||
if (options.createIndex()) {
|
||||
Content indexlink;
|
||||
if (options.splitIndex) {
|
||||
if (options.splitIndex()) {
|
||||
indexlink = links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
|
||||
resources.getText("doclet.Index"));
|
||||
} else {
|
||||
|
@ -188,7 +188,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
docPaths = new DocPaths(utils);
|
||||
setCreateOverview();
|
||||
setTopFile(docEnv);
|
||||
workArounds.initDocLint(options.doclintOpts.values(), tagletManager.getAllTagletNames());
|
||||
workArounds.initDocLint(options.doclintOpts().values(), tagletManager.getAllTagletNames());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
if (!checkForDeprecation(docEnv)) {
|
||||
return;
|
||||
}
|
||||
if (options.createOverview) {
|
||||
if (options.createOverview()) {
|
||||
topFile = DocPaths.INDEX;
|
||||
} else {
|
||||
if (showModules) {
|
||||
@ -224,7 +224,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
}
|
||||
|
||||
protected TypeElement getValidClass(List<TypeElement> classes) {
|
||||
if (!options.noDeprecated) {
|
||||
if (!options.noDeprecated()) {
|
||||
return classes.get(0);
|
||||
}
|
||||
for (TypeElement te : classes) {
|
||||
@ -246,14 +246,14 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
|
||||
/**
|
||||
* Generate "overview.html" page if option "-overview" is used or number of
|
||||
* packages is more than one. Sets {@link HtmlOptions#createOverview} field to true.
|
||||
* packages is more than one. Sets {@code HtmlOptions.createOverview} field to true.
|
||||
*/
|
||||
protected void setCreateOverview() {
|
||||
if (!options.noOverview) {
|
||||
if (options.overviewPath != null
|
||||
if (!options.noOverview()) {
|
||||
if (options.overviewPath() != null
|
||||
|| modules.size() > 1
|
||||
|| (modules.isEmpty() && packages.size() > 1)) {
|
||||
options.createOverview = true;
|
||||
options.setCreateOverview(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -283,7 +283,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
*/
|
||||
@Override
|
||||
public JavaFileObject getOverviewPath() {
|
||||
String overviewpath = options.overviewPath;
|
||||
String overviewpath = options.overviewPath();
|
||||
if (overviewpath != null && getFileManager() instanceof StandardJavaFileManager) {
|
||||
StandardJavaFileManager fm = (StandardJavaFileManager) getFileManager();
|
||||
return fm.getJavaFileObjects(overviewpath).iterator().next();
|
||||
@ -292,7 +292,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
}
|
||||
|
||||
public DocPath getMainStylesheet() {
|
||||
String stylesheetfile = options.stylesheetFile;
|
||||
String stylesheetfile = options.stylesheetFile();
|
||||
if(!stylesheetfile.isEmpty()){
|
||||
DocFile docFile = DocFile.createFileForInput(this, stylesheetfile);
|
||||
return DocPath.create(docFile.getName());
|
||||
@ -301,7 +301,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
}
|
||||
|
||||
public List<DocPath> getAdditionalStylesheets() {
|
||||
return options.additionalStylesheets.stream()
|
||||
return options.additionalStylesheets().stream()
|
||||
.map(ssf -> DocFile.createFileForInput(this, ssf)).map(file -> DocPath.create(file.getName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
@ -342,16 +342,18 @@ public class HtmlConfiguration extends BaseConfiguration {
|
||||
|
||||
@Override
|
||||
protected boolean finishOptionSettings0() throws DocletException {
|
||||
if (options.docEncoding == null) {
|
||||
if (options.charset == null) {
|
||||
options.docEncoding = options.charset = (options.encoding == null) ? HTML_DEFAULT_CHARSET : options.encoding;
|
||||
if (options.docEncoding() == null) {
|
||||
if (options.charset() == null) {
|
||||
String charset = (options.encoding() == null) ? HTML_DEFAULT_CHARSET : options.encoding();
|
||||
options.setCharset(charset);
|
||||
options.setDocEncoding((options.charset()));
|
||||
} else {
|
||||
options.docEncoding = options.charset;
|
||||
options.setDocEncoding(options.charset());
|
||||
}
|
||||
} else {
|
||||
if (options.charset == null) {
|
||||
options.charset = options.docEncoding;
|
||||
} else if (!options.charset.equals(options.docEncoding)) {
|
||||
if (options.charset() == null) {
|
||||
options.setCharset(options.docEncoding());
|
||||
} else if (!options.charset().equals(options.docEncoding())) {
|
||||
reporter.print(ERROR, resources.getText("doclet.Option_conflict", "-charset", "-docencoding"));
|
||||
return false;
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class HtmlDoclet extends AbstractDoclet {
|
||||
throws DocletException {
|
||||
super.generateOtherFiles(docEnv, classtree);
|
||||
HtmlOptions options = configuration.getOptions();
|
||||
if (options.linkSource) {
|
||||
if (options.linkSource()) {
|
||||
SourceToHTMLConverter.convertRoot(configuration,
|
||||
docEnv, DocPaths.SOURCE_OUTPUT);
|
||||
}
|
||||
@ -120,27 +120,27 @@ public class HtmlDoclet extends AbstractDoclet {
|
||||
messages.error("doclet.No_Non_Deprecated_Classes_To_Document");
|
||||
return;
|
||||
}
|
||||
boolean nodeprecated = options.noDeprecated;
|
||||
performCopy(options.helpFile);
|
||||
performCopy(options.stylesheetFile);
|
||||
for (String stylesheet : options.additionalStylesheets) {
|
||||
boolean nodeprecated = options.noDeprecated();
|
||||
performCopy(options.helpFile());
|
||||
performCopy(options.stylesheetFile());
|
||||
for (String stylesheet : options.additionalStylesheets()) {
|
||||
performCopy(stylesheet);
|
||||
}
|
||||
// do early to reduce memory footprint
|
||||
if (options.classUse) {
|
||||
if (options.classUse()) {
|
||||
ClassUseWriter.generate(configuration, classtree);
|
||||
}
|
||||
IndexBuilder indexbuilder = new IndexBuilder(configuration, nodeprecated);
|
||||
|
||||
if (options.createTree) {
|
||||
if (options.createTree()) {
|
||||
TreeWriter.generate(configuration, classtree);
|
||||
}
|
||||
|
||||
if (!(options.noDeprecatedList || nodeprecated)) {
|
||||
if (!(options.noDeprecatedList() || nodeprecated)) {
|
||||
DeprecatedListWriter.generate(configuration);
|
||||
}
|
||||
|
||||
if (options.createOverview) {
|
||||
if (options.createOverview()) {
|
||||
if (configuration.showModules) {
|
||||
ModuleIndexWriter.generate(configuration);
|
||||
} else {
|
||||
@ -148,9 +148,9 @@ public class HtmlDoclet extends AbstractDoclet {
|
||||
}
|
||||
}
|
||||
|
||||
if (options.createIndex) {
|
||||
if (options.createIndex()) {
|
||||
configuration.buildSearchTagIndex();
|
||||
if (options.splitIndex) {
|
||||
if (options.splitIndex()) {
|
||||
SplitIndexWriter.generate(configuration, indexbuilder);
|
||||
} else {
|
||||
SingleIndexWriter.generate(configuration, indexbuilder);
|
||||
@ -163,25 +163,25 @@ public class HtmlDoclet extends AbstractDoclet {
|
||||
SystemPropertiesWriter.generate(configuration);
|
||||
}
|
||||
|
||||
if (options.createOverview) {
|
||||
if (options.createOverview()) {
|
||||
IndexRedirectWriter.generate(configuration, DocPaths.OVERVIEW_SUMMARY, DocPaths.INDEX);
|
||||
} else {
|
||||
IndexRedirectWriter.generate(configuration);
|
||||
}
|
||||
|
||||
if (options.helpFile.isEmpty() && !options.noHelp) {
|
||||
if (options.helpFile().isEmpty() && !options.noHelp()) {
|
||||
HelpWriter.generate(configuration);
|
||||
}
|
||||
// If a stylesheet file is not specified, copy the default stylesheet
|
||||
// and replace newline with platform-specific newline.
|
||||
DocFile f;
|
||||
if (options.stylesheetFile.length() == 0) {
|
||||
if (options.stylesheetFile().length() == 0) {
|
||||
f = DocFile.createFileForOutput(configuration, DocPaths.STYLESHEET);
|
||||
f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.STYLESHEET), true, true);
|
||||
}
|
||||
f = DocFile.createFileForOutput(configuration, DocPaths.JAVASCRIPT);
|
||||
f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.JAVASCRIPT), true, true);
|
||||
if (options.createIndex) {
|
||||
if (options.createIndex()) {
|
||||
f = DocFile.createFileForOutput(configuration, DocPaths.SEARCH_JS);
|
||||
f.copyResource(DOCLET_RESOURCES.resolve(DocPaths.SEARCH_JS), true, true);
|
||||
|
||||
@ -280,12 +280,12 @@ public class HtmlDoclet extends AbstractDoclet {
|
||||
// if -nodeprecated option is set and the package is marked as
|
||||
// deprecated, do not generate the package-summary.html, package-frame.html
|
||||
// and package-tree.html pages for that package.
|
||||
if (!(options.noDeprecated && utils.isDeprecated(pkg))) {
|
||||
if (!(options.noDeprecated() && utils.isDeprecated(pkg))) {
|
||||
AbstractBuilder packageSummaryBuilder =
|
||||
configuration.getBuilderFactory().getPackageSummaryBuilder(pkg);
|
||||
packageSummaryBuilder.build();
|
||||
if (options.createTree) {
|
||||
PackageTreeWriter.generate(configuration, pkg, options.noDeprecated);
|
||||
if (options.createTree()) {
|
||||
PackageTreeWriter.generate(configuration, pkg, options.noDeprecated());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -262,9 +262,9 @@ public class HtmlDocletWriter {
|
||||
// append htmlstr up to start of next {@docroot}
|
||||
buf.append(htmlstr.substring(prevEnd, match));
|
||||
prevEnd = docrootMatcher.end();
|
||||
if (options.docrootParent.length() > 0 && htmlstr.startsWith("/..", prevEnd)) {
|
||||
if (options.docrootParent().length() > 0 && htmlstr.startsWith("/..", prevEnd)) {
|
||||
// Insert the absolute link if {@docRoot} is followed by "/..".
|
||||
buf.append(options.docrootParent);
|
||||
buf.append(options.docrootParent());
|
||||
prevEnd += 3;
|
||||
} else {
|
||||
// Insert relative path where {@docRoot} was located
|
||||
@ -342,7 +342,7 @@ public class HtmlDocletWriter {
|
||||
* @param htmltree the documentation tree to which the tags will be added
|
||||
*/
|
||||
protected void addTagsInfo(Element e, Content htmltree) {
|
||||
if (options.noComment) {
|
||||
if (options.noComment()) {
|
||||
return;
|
||||
}
|
||||
Content dl = new HtmlTree(HtmlTag.DL);
|
||||
@ -451,14 +451,14 @@ public class HtmlDocletWriter {
|
||||
List<DocPath> additionalStylesheets = configuration.getAdditionalStylesheets();
|
||||
additionalStylesheets.addAll(localStylesheets);
|
||||
Head head = new Head(path, configuration.docletVersion, configuration.startTime)
|
||||
.setTimestamp(!options.noTimestamp)
|
||||
.setTimestamp(!options.noTimestamp())
|
||||
.setDescription(description)
|
||||
.setGenerator(getGenerator(getClass()))
|
||||
.setTitle(winTitle)
|
||||
.setCharset(options.charset)
|
||||
.setCharset(options.charset())
|
||||
.addKeywords(metakeywords)
|
||||
.setStylesheets(configuration.getMainStylesheet(), additionalStylesheets)
|
||||
.setIndex(options.createIndex, mainBodyScript)
|
||||
.setIndex(options.createIndex(), mainBodyScript)
|
||||
.addContent(extraHeadContent);
|
||||
|
||||
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
|
||||
@ -473,8 +473,8 @@ public class HtmlDocletWriter {
|
||||
* @return the window title string
|
||||
*/
|
||||
public String getWindowTitle(String title) {
|
||||
if (options.windowTitle.length() > 0) {
|
||||
title += " (" + options.windowTitle + ")";
|
||||
if (options.windowTitle().length() > 0) {
|
||||
title += " (" + options.windowTitle() + ")";
|
||||
}
|
||||
return title;
|
||||
}
|
||||
@ -488,12 +488,12 @@ public class HtmlDocletWriter {
|
||||
public Content getUserHeaderFooter(boolean header) {
|
||||
String content;
|
||||
if (header) {
|
||||
content = replaceDocRootDir(options.header);
|
||||
content = replaceDocRootDir(options.header());
|
||||
} else {
|
||||
if (options.footer.length() != 0) {
|
||||
content = replaceDocRootDir(options.footer);
|
||||
if (options.footer().length() != 0) {
|
||||
content = replaceDocRootDir(options.footer());
|
||||
} else {
|
||||
content = replaceDocRootDir(options.header);
|
||||
content = replaceDocRootDir(options.header());
|
||||
}
|
||||
}
|
||||
Content rawContent = new RawHtml(content);
|
||||
@ -506,7 +506,7 @@ public class HtmlDocletWriter {
|
||||
* @param htmlTree the content tree to which user specified top will be added
|
||||
*/
|
||||
public void addTop(Content htmlTree) {
|
||||
Content top = new RawHtml(replaceDocRootDir(options.top));
|
||||
Content top = new RawHtml(replaceDocRootDir(options.top()));
|
||||
htmlTree.add(top);
|
||||
}
|
||||
|
||||
@ -516,7 +516,7 @@ public class HtmlDocletWriter {
|
||||
* @param htmlTree the content tree to which user specified bottom will be added
|
||||
*/
|
||||
public void addBottom(Content htmlTree) {
|
||||
Content bottom = new RawHtml(replaceDocRootDir(options.bottom));
|
||||
Content bottom = new RawHtml(replaceDocRootDir(options.bottom()));
|
||||
Content small = HtmlTree.SMALL(bottom);
|
||||
Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
|
||||
htmlTree.add(p);
|
||||
@ -1262,7 +1262,7 @@ public class HtmlDocletWriter {
|
||||
*/
|
||||
private void addCommentTags(Element element, DocTree holderTag, List<? extends DocTree> tags, boolean depr,
|
||||
boolean first, boolean inSummary, Content htmltree) {
|
||||
if (options.noComment){
|
||||
if (options.noComment()){
|
||||
return;
|
||||
}
|
||||
Content div;
|
||||
@ -1423,8 +1423,8 @@ public class HtmlDocletWriter {
|
||||
for (DocTree dt : node.getValue()) {
|
||||
if (utils.isText(dt) && isHRef) {
|
||||
String text = ((TextTree) dt).getBody();
|
||||
if (text.startsWith("/..") && !options.docrootParent.isEmpty()) {
|
||||
result.add(options.docrootParent);
|
||||
if (text.startsWith("/..") && !options.docrootParent().isEmpty()) {
|
||||
result.add(options.docrootParent());
|
||||
docRootContent = new ContentBuilder();
|
||||
result.add(textCleanup(text.substring(3), isLastNode));
|
||||
} else {
|
||||
|
@ -51,140 +51,146 @@ import static javax.tools.Diagnostic.Kind.WARNING;
|
||||
* including the format-independent options handled
|
||||
* by {@link BaseOptions}.
|
||||
*
|
||||
* <p>Some of the methods used to access the values of options
|
||||
* have names that begin with a verb, such as {@link #createOverview}
|
||||
* or {@link #splitIndex}. Unless otherwise stated,
|
||||
* these methods should all be taken as just accessing the value
|
||||
* of the associated option.
|
||||
*
|
||||
*/
|
||||
public class HtmlOptions extends BaseOptions {
|
||||
//<editor-fold desc="Option values">
|
||||
/**
|
||||
* Argument for command-line option {@code --add-stylesheet}.
|
||||
*/
|
||||
public List<String> additionalStylesheets = new ArrayList<>();
|
||||
private List<String> additionalStylesheets = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -bottom}.
|
||||
*/
|
||||
public String bottom = "";
|
||||
private String bottom = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -charset}.
|
||||
* The META charset tag used for cross-platform viewing.
|
||||
*/
|
||||
public String charset = null;
|
||||
private String charset = null;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -use}.
|
||||
* True if command-line option "-use" is used. Default value is false.
|
||||
*/
|
||||
public boolean classUse = false;
|
||||
private boolean classUse = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -noindex}.
|
||||
* False if command-line option "-noindex" is used. Default value is true.
|
||||
*/
|
||||
public boolean createIndex = true;
|
||||
private boolean createIndex = true;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -overview}.
|
||||
* This is true if option "-overview" is used or option "-overview" is not
|
||||
* used and number of packages is more than one.
|
||||
*/
|
||||
public boolean createOverview = false;
|
||||
private boolean createOverview = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -notree}.
|
||||
* False if command-line option "-notree" is used. Default value is true.
|
||||
*/
|
||||
public boolean createTree = true;
|
||||
private boolean createTree = true;
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -Xdoclint} and friends.
|
||||
* Collected set of doclint options.
|
||||
*/
|
||||
public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
|
||||
private Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -Xdocrootparent}.
|
||||
*/
|
||||
public String docrootParent = "";
|
||||
private String docrootParent = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -doctitle}.
|
||||
*/
|
||||
public String docTitle = "";
|
||||
private String docTitle = "";
|
||||
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -footer}.
|
||||
*/
|
||||
public String footer = "";
|
||||
private String footer = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -header}.
|
||||
*/
|
||||
public String header = "";
|
||||
private String header = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -helpfile}.
|
||||
*/
|
||||
public String helpFile = "";
|
||||
private String helpFile = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nodeprecated}.
|
||||
* True if command-line option "-nodeprecated" is used. Default value is
|
||||
* false.
|
||||
*/
|
||||
public boolean noDeprecatedList = false;
|
||||
private boolean noDeprecatedList = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nohelp}.
|
||||
* True if command-line option "-nohelp" is used. Default value is false.
|
||||
*/
|
||||
public boolean noHelp = false;
|
||||
private boolean noHelp = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nonavbar}.
|
||||
* True if command-line option "-nonavbar" is used. Default value is false.
|
||||
*/
|
||||
public boolean noNavbar = false;
|
||||
private boolean noNavbar = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nooverview}.
|
||||
* True if command-line option "-nooverview" is used. Default value is
|
||||
* false
|
||||
*/
|
||||
boolean noOverview = false;
|
||||
private boolean noOverview = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -overview}.
|
||||
* The overview path specified with "-overview" flag.
|
||||
*/
|
||||
public String overviewPath = null;
|
||||
private String overviewPath = null;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -packagesheader}.
|
||||
*/
|
||||
public String packagesHeader = "";
|
||||
private String packagesHeader = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -splitindex}.
|
||||
* True if command-line option "-splitindex" is used. Default value is
|
||||
* false.
|
||||
*/
|
||||
public boolean splitIndex = false;
|
||||
private boolean splitIndex = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -stylesheetfile}.
|
||||
*/
|
||||
public String stylesheetFile = "";
|
||||
private String stylesheetFile = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -top}.
|
||||
*/
|
||||
public String top = "";
|
||||
private String top = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -windowtitle}.
|
||||
*/
|
||||
public String windowTitle = "";
|
||||
private String windowTitle = "";
|
||||
//</editor-fold>
|
||||
|
||||
private HtmlConfiguration config;
|
||||
@ -516,4 +522,188 @@ public class HtmlOptions extends BaseOptions {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --add-stylesheet}.
|
||||
*/
|
||||
List<String> additionalStylesheets() {
|
||||
return additionalStylesheets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -bottom}.
|
||||
*/
|
||||
String bottom() {
|
||||
return bottom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -charset}.
|
||||
* The META charset tag used for cross-platform viewing.
|
||||
*/
|
||||
String charset() {
|
||||
return charset;
|
||||
}
|
||||
|
||||
void setCharset(String charset) {
|
||||
this.charset = charset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -use}.
|
||||
* True if command-line option "-use" is used. Default value is false.
|
||||
*/
|
||||
public boolean classUse() {
|
||||
return classUse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -noindex}.
|
||||
* False if command-line option "-noindex" is used. Default value is true.
|
||||
*/
|
||||
public boolean createIndex() {
|
||||
return createIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -overview}.
|
||||
* This is true if option "-overview" is used or option "-overview" is not
|
||||
* used and number of packages is more than one.
|
||||
*/
|
||||
public boolean createOverview() {
|
||||
return createOverview;
|
||||
}
|
||||
|
||||
public void setCreateOverview(boolean createOverview) {
|
||||
this.createOverview = createOverview;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -notree}.
|
||||
* False if command-line option "-notree" is used. Default value is true.
|
||||
*/
|
||||
public boolean createTree() {
|
||||
return createTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -Xdoclint} and friends.
|
||||
* Collected set of doclint options.
|
||||
*/
|
||||
Map<Doclet.Option, String> doclintOpts() {
|
||||
return doclintOpts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -Xdocrootparent}.
|
||||
*/
|
||||
String docrootParent() {
|
||||
return docrootParent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -doctitle}.
|
||||
*/
|
||||
String docTitle() {
|
||||
return docTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -footer}.
|
||||
*/
|
||||
String footer() {
|
||||
return footer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -header}.
|
||||
*/
|
||||
String header() {
|
||||
return header;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -helpfile}.
|
||||
*/
|
||||
public String helpFile() {
|
||||
return helpFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nodeprecated}.
|
||||
* True if command-line option "-nodeprecated" is used. Default value is
|
||||
* false.
|
||||
*/
|
||||
public boolean noDeprecatedList() {
|
||||
return noDeprecatedList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nohelp}.
|
||||
* True if command-line option "-nohelp" is used. Default value is false.
|
||||
*/
|
||||
public boolean noHelp() {
|
||||
return noHelp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nonavbar}.
|
||||
* True if command-line option "-nonavbar" is used. Default value is false.
|
||||
*/
|
||||
public boolean noNavbar() {
|
||||
return noNavbar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nooverview}.
|
||||
* True if command-line option "-nooverview" is used. Default value is
|
||||
* false
|
||||
*/
|
||||
boolean noOverview() {
|
||||
return noOverview;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -overview}.
|
||||
* The overview path specified with "-overview" flag.
|
||||
*/
|
||||
String overviewPath() {
|
||||
return overviewPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -packagesheader}.
|
||||
*/
|
||||
String packagesHeader() {
|
||||
return packagesHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -splitindex}.
|
||||
* True if command-line option "-splitindex" is used. Default value is
|
||||
* false.
|
||||
*/
|
||||
public boolean splitIndex() {
|
||||
return splitIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -stylesheetfile}.
|
||||
*/
|
||||
String stylesheetFile() {
|
||||
return stylesheetFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -top}.
|
||||
*/
|
||||
String top() {
|
||||
return top;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -windowtitle}.
|
||||
*/
|
||||
String windowTitle() {
|
||||
return windowTitle;
|
||||
}
|
||||
}
|
||||
|
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java
@ -207,7 +207,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
|
||||
* @return true if overview details need to be printed
|
||||
*/
|
||||
public boolean shouldPrintOverview(VariableElement field) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
if(!utils.getFullBody(field).isEmpty() ||
|
||||
writer.hasSerializationOverviewTags(field))
|
||||
return true;
|
||||
|
@ -75,18 +75,18 @@ public class IndexRedirectWriter extends HtmlDocletWriter {
|
||||
private void generateIndexFile() throws DocFileIOException {
|
||||
Content htmlComment = contents.newPage;
|
||||
Head head = new Head(path, configuration.docletVersion, configuration.startTime)
|
||||
.setTimestamp(!options.noTimestamp)
|
||||
.setTimestamp(!options.noTimestamp())
|
||||
.setDescription("index redirect")
|
||||
.setGenerator(getGenerator(getClass()))
|
||||
.setStylesheets(configuration.getMainStylesheet(), Collections.emptyList()) // avoid reference to default stylesheet
|
||||
.addDefaultScript(false);
|
||||
|
||||
String title = (options.windowTitle.length() > 0)
|
||||
? options.windowTitle
|
||||
String title = (options.windowTitle().length() > 0)
|
||||
? options.windowTitle()
|
||||
: resources.getText("doclet.Generated_Docs_Untitled");
|
||||
|
||||
head.setTitle(title)
|
||||
.setCharset(options.charset)
|
||||
.setCharset(options.charset())
|
||||
.setCanonicalLink(target);
|
||||
|
||||
String targetPath = target.getPath();
|
||||
|
@ -253,7 +253,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
Content classLink = writer.getPreQualifiedClassLink(
|
||||
LinkInfoImpl.Kind.MEMBER, typeElement, false);
|
||||
Content label;
|
||||
if (options.summarizeOverriddenMethods) {
|
||||
if (options.summarizeOverriddenMethods()) {
|
||||
label = new StringContent(utils.isClass(typeElement)
|
||||
? resources.getText("doclet.Methods_Declared_In_Class")
|
||||
: resources.getText("doclet.Methods_Declared_In_Interface"));
|
||||
@ -285,7 +285,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
*/
|
||||
protected static void addOverridden(HtmlDocletWriter writer,
|
||||
TypeMirror overriddenType, ExecutableElement method, Content dl) {
|
||||
if (writer.options.noComment) {
|
||||
if (writer.options.noComment()) {
|
||||
return;
|
||||
}
|
||||
Utils utils = writer.utils;
|
||||
@ -336,7 +336,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
protected static void addImplementsInfo(HtmlDocletWriter writer,
|
||||
ExecutableElement method, Content dl) {
|
||||
Utils utils = writer.utils;
|
||||
if (utils.isStatic(method) || writer.options.noComment) {
|
||||
if (utils.isStatic(method) || writer.options.noComment()) {
|
||||
return;
|
||||
}
|
||||
Contents contents = writer.contents;
|
||||
|
@ -108,7 +108,7 @@ public class ModuleIndexWriter extends AbstractOverviewIndexWriter {
|
||||
|
||||
for (ModuleElement mdle : modules) {
|
||||
if (!mdle.isUnnamed()) {
|
||||
if (!(options.noDeprecated && utils.isDeprecated(mdle))) {
|
||||
if (!(options.noDeprecated() && utils.isDeprecated(mdle))) {
|
||||
Content moduleLinkContent = getModuleLink(mdle, new StringContent(mdle.getQualifiedName().toString()));
|
||||
Content summaryContent = new ContentBuilder();
|
||||
addSummaryComment(mdle, summaryContent);
|
||||
|
@ -188,7 +188,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
HtmlTree bodyTree = getBody(getWindowTitle(mdle.getQualifiedName().toString()));
|
||||
Content headerContent = new ContentBuilder();
|
||||
addTop(headerContent);
|
||||
navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !options.noComment);
|
||||
navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !options.noComment());
|
||||
navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules));
|
||||
navBar.setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages)
|
||||
|| display(indirectOpenPackages));
|
||||
|
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
@ -122,7 +122,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
|
||||
Content classLink = writer.getPreQualifiedClassLink(
|
||||
LinkInfoImpl.Kind.MEMBER, typeElement, false);
|
||||
Content label;
|
||||
if (options.summarizeOverriddenMethods) {
|
||||
if (options.summarizeOverriddenMethods()) {
|
||||
label = new StringContent(utils.isInterface(typeElement)
|
||||
? resources.getText("doclet.Nested_Classes_Interfaces_Declared_In_Interface")
|
||||
: resources.getText("doclet.Nested_Classes_Interfaces_Declared_In_Class"));
|
||||
|
@ -109,7 +109,7 @@ public class PackageIndexWriter extends AbstractOverviewIndexWriter {
|
||||
|
||||
for (PackageElement pkg : configuration.packages) {
|
||||
if (!pkg.isUnnamed()) {
|
||||
if (!(options.noDeprecated && utils.isDeprecated(pkg))) {
|
||||
if (!(options.noDeprecated() && utils.isDeprecated(pkg))) {
|
||||
Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg));
|
||||
Content summaryContent = new ContentBuilder();
|
||||
addSummaryComment(pkg, summaryContent);
|
||||
|
@ -213,7 +213,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
|
||||
Content classLink = writer.getPreQualifiedClassLink(
|
||||
LinkInfoImpl.Kind.MEMBER, typeElement, false);
|
||||
Content label;
|
||||
if (options.summarizeOverriddenMethods) {
|
||||
if (options.summarizeOverriddenMethods()) {
|
||||
label = new StringContent(utils.isClass(typeElement)
|
||||
? resources.getText("doclet.Properties_Declared_In_Class")
|
||||
: resources.getText("doclet.Properties_Declared_In_Interface"));
|
||||
|
14
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java
14
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java
@ -124,20 +124,20 @@ public class SourceToHTMLConverter {
|
||||
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)))
|
||||
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)))
|
||||
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 &&
|
||||
if (!(options.noDeprecated() &&
|
||||
(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te)))))
|
||||
convertClass(te, outputdir);
|
||||
}
|
||||
@ -161,7 +161,7 @@ public class SourceToHTMLConverter {
|
||||
// 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)))
|
||||
if (!(options.noDeprecated() && utils.isDeprecated(te)))
|
||||
convertClass((TypeElement)te, outputdir);
|
||||
}
|
||||
}
|
||||
@ -181,7 +181,7 @@ public class SourceToHTMLConverter {
|
||||
}
|
||||
for (Element elem : mdl.getEnclosedElements()) {
|
||||
if (elem instanceof PackageElement && configuration.docEnv.isIncluded(elem)
|
||||
&& !(options.noDeprecated && utils.isDeprecated(elem))) {
|
||||
&& !(options.noDeprecated() && utils.isDeprecated(elem))) {
|
||||
convertPackage((PackageElement) elem, outputdir);
|
||||
}
|
||||
}
|
||||
@ -258,7 +258,7 @@ public class SourceToHTMLConverter {
|
||||
* @param head an HtmlTree to which the stylesheet links will be added
|
||||
*/
|
||||
public void addStyleSheetProperties(Content head) {
|
||||
String filename = options.stylesheetFile;
|
||||
String filename = options.stylesheetFile();
|
||||
DocPath stylesheet;
|
||||
if (filename.length() > 0) {
|
||||
DocFile file = DocFile.createFileForInput(configuration, filename);
|
||||
@ -273,7 +273,7 @@ public class SourceToHTMLConverter {
|
||||
}
|
||||
|
||||
protected void addStylesheets(Content tree) {
|
||||
List<String> stylesheets = options.additionalStylesheets;
|
||||
List<String> stylesheets = options.additionalStylesheets();
|
||||
if (!stylesheets.isEmpty()) {
|
||||
stylesheets.forEach((ssheet) -> {
|
||||
DocFile file = DocFile.createFileForInput(configuration, ssheet);
|
||||
|
@ -440,7 +440,7 @@ public class TagletWriterImpl extends TagletWriter {
|
||||
anchorName += "-" + count;
|
||||
}
|
||||
result = HtmlTree.SPAN(anchorName, HtmlStyle.searchTagResult, new StringContent(tagText));
|
||||
if (options.createIndex && !tagText.isEmpty()) {
|
||||
if (options.createIndex() && !tagText.isEmpty()) {
|
||||
SearchIndexItem si = new SearchIndexItem();
|
||||
si.setSystemProperty(isSystemProperty);
|
||||
si.setLabel(tagText);
|
||||
|
@ -155,7 +155,7 @@ public class TreeWriter extends AbstractTreeWriter {
|
||||
// is set and the package is marked as deprecated, do not include
|
||||
// the page in the list of package hierarchies.
|
||||
if (pkg.isUnnamed() ||
|
||||
(options.noDeprecated && utils.isDeprecated(pkg))) {
|
||||
(options.noDeprecated() && utils.isDeprecated(pkg))) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
@ -203,11 +203,11 @@ public class Navigation {
|
||||
private void addMainNavLinks(Content tree) {
|
||||
switch (documentedPage) {
|
||||
case OVERVIEW:
|
||||
addActivePageLink(tree, contents.overviewLabel, options.createOverview);
|
||||
addActivePageLink(tree, contents.overviewLabel, options.createOverview());
|
||||
addModuleLink(tree);
|
||||
addPackageLink(tree);
|
||||
addPageLabel(tree, contents.classLabel, true);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse());
|
||||
addTreeLink(tree);
|
||||
addDeprecatedLink(tree);
|
||||
addIndexLink(tree);
|
||||
@ -218,7 +218,7 @@ public class Navigation {
|
||||
addActivePageLink(tree, contents.moduleLabel, configuration.showModules);
|
||||
addPackageLink(tree);
|
||||
addPageLabel(tree, contents.classLabel, true);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse());
|
||||
addTreeLink(tree);
|
||||
addDeprecatedLink(tree);
|
||||
addIndexLink(tree);
|
||||
@ -229,11 +229,11 @@ public class Navigation {
|
||||
addModuleOfElementLink(tree);
|
||||
addActivePageLink(tree, contents.packageLabel, true);
|
||||
addPageLabel(tree, contents.classLabel, true);
|
||||
if (options.classUse) {
|
||||
if (options.classUse()) {
|
||||
addContentToTree(tree, links.createLink(DocPaths.PACKAGE_USE,
|
||||
contents.useLabel, "", ""));
|
||||
}
|
||||
if (options.createTree) {
|
||||
if (options.createTree()) {
|
||||
addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE,
|
||||
contents.treeLabel, "", ""));
|
||||
}
|
||||
@ -246,11 +246,11 @@ public class Navigation {
|
||||
addModuleOfElementLink(tree);
|
||||
addPackageSummaryLink(tree);
|
||||
addActivePageLink(tree, contents.classLabel, true);
|
||||
if (options.classUse) {
|
||||
if (options.classUse()) {
|
||||
addContentToTree(tree, links.createLink(DocPaths.CLASS_USE.resolve(path.basename()),
|
||||
contents.useLabel));
|
||||
}
|
||||
if (options.createTree) {
|
||||
if (options.createTree()) {
|
||||
addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE,
|
||||
contents.treeLabel, "", ""));
|
||||
}
|
||||
@ -268,7 +268,7 @@ public class Navigation {
|
||||
addPackageOfElementLink(tree);
|
||||
addContentToTree(tree, navLinkClass);
|
||||
}
|
||||
addActivePageLink(tree, contents.useLabel, options.classUse);
|
||||
addActivePageLink(tree, contents.useLabel, options.classUse());
|
||||
if (element instanceof PackageElement) {
|
||||
addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE, contents.treeLabel));
|
||||
} else {
|
||||
@ -290,8 +290,8 @@ public class Navigation {
|
||||
addPackageSummaryLink(tree);
|
||||
}
|
||||
addPageLabel(tree, contents.classLabel, true);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse);
|
||||
addActivePageLink(tree, contents.treeLabel, options.createTree);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse());
|
||||
addActivePageLink(tree, contents.treeLabel, options.createTree());
|
||||
addDeprecatedLink(tree);
|
||||
addIndexLink(tree);
|
||||
addHelpLink(tree);
|
||||
@ -303,21 +303,21 @@ public class Navigation {
|
||||
addModuleLink(tree);
|
||||
addPackageLink(tree);
|
||||
addPageLabel(tree, contents.classLabel, true);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse());
|
||||
addTreeLink(tree);
|
||||
if (documentedPage == PageMode.DEPRECATED) {
|
||||
addActivePageLink(tree, contents.deprecatedLabel, !(options.noDeprecated
|
||||
|| options.noDeprecatedList));
|
||||
addActivePageLink(tree, contents.deprecatedLabel, !(options.noDeprecated()
|
||||
|| options.noDeprecatedList()));
|
||||
} else {
|
||||
addDeprecatedLink(tree);
|
||||
}
|
||||
if (documentedPage == PageMode.INDEX) {
|
||||
addActivePageLink(tree, contents.indexLabel, options.createIndex);
|
||||
addActivePageLink(tree, contents.indexLabel, options.createIndex());
|
||||
} else {
|
||||
addIndexLink(tree);
|
||||
}
|
||||
if (documentedPage == PageMode.HELP) {
|
||||
addActivePageLink(tree, contents.helpLabel, !options.noHelp);
|
||||
addActivePageLink(tree, contents.helpLabel, !options.noHelp());
|
||||
} else {
|
||||
addHelpLink(tree);
|
||||
}
|
||||
@ -331,7 +331,7 @@ public class Navigation {
|
||||
addModuleLink(tree);
|
||||
addPackageLink(tree);
|
||||
addPageLabel(tree, contents.classLabel, true);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse());
|
||||
addTreeLink(tree);
|
||||
addDeprecatedLink(tree);
|
||||
addIndexLink(tree);
|
||||
@ -342,7 +342,7 @@ public class Navigation {
|
||||
addModuleOfElementLink(tree);
|
||||
addContentToTree(tree, navLinkPackage);
|
||||
addPageLabel(tree, contents.classLabel, true);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse);
|
||||
addPageLabel(tree, contents.useLabel, options.classUse());
|
||||
addTreeLink(tree);
|
||||
addDeprecatedLink(tree);
|
||||
addIndexLink(tree);
|
||||
@ -785,7 +785,7 @@ public class Navigation {
|
||||
}
|
||||
|
||||
private void addOverviewLink(Content tree) {
|
||||
if (options.createOverview) {
|
||||
if (options.createOverview()) {
|
||||
tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.INDEX),
|
||||
contents.overviewLabel, "", "")));
|
||||
}
|
||||
@ -851,7 +851,7 @@ public class Navigation {
|
||||
}
|
||||
|
||||
private void addTreeLink(Content tree) {
|
||||
if (options.createTree) {
|
||||
if (options.createTree()) {
|
||||
List<PackageElement> packages = new ArrayList<>(configuration.getSpecifiedPackageElements());
|
||||
DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty()
|
||||
? pathToRoot.resolve(configuration.docPaths.forPackage(packages.get(0)).resolve(DocPaths.PACKAGE_TREE))
|
||||
@ -861,16 +861,16 @@ public class Navigation {
|
||||
}
|
||||
|
||||
private void addDeprecatedLink(Content tree) {
|
||||
if (!(options.noDeprecated || options.noDeprecatedList)) {
|
||||
if (!(options.noDeprecated() || options.noDeprecatedList())) {
|
||||
tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
|
||||
contents.deprecatedLabel, "", "")));
|
||||
}
|
||||
}
|
||||
|
||||
private void addIndexLink(Content tree) {
|
||||
if (options.createIndex) {
|
||||
if (options.createIndex()) {
|
||||
tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(
|
||||
(options.splitIndex
|
||||
(options.splitIndex()
|
||||
? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1))
|
||||
: DocPaths.INDEX_ALL)),
|
||||
contents.indexLabel, "", "")));
|
||||
@ -878,8 +878,8 @@ public class Navigation {
|
||||
}
|
||||
|
||||
private void addHelpLink(Content tree) {
|
||||
if (!options.noHelp) {
|
||||
String helpfile = options.helpFile;
|
||||
if (!options.noHelp()) {
|
||||
String helpfile = options.helpFile();
|
||||
DocPath helpfilenm;
|
||||
if (helpfile.isEmpty()) {
|
||||
helpfilenm = DocPaths.HELP_DOC;
|
||||
@ -910,7 +910,7 @@ public class Navigation {
|
||||
* @return the navigation contents
|
||||
*/
|
||||
public Content getContent(boolean top) {
|
||||
if (options.noNavbar) {
|
||||
if (options.noNavbar()) {
|
||||
return new ContentBuilder();
|
||||
}
|
||||
Content tree = HtmlTree.NAV();
|
||||
@ -955,7 +955,7 @@ public class Navigation {
|
||||
addDetailLinks(ulNavDetail);
|
||||
div.add(ulNavDetail);
|
||||
subDiv.add(div);
|
||||
if (top && options.createIndex) {
|
||||
if (top && options.createIndex()) {
|
||||
addSearch(subDiv);
|
||||
}
|
||||
tree.add(subDiv);
|
||||
|
@ -126,16 +126,16 @@ public abstract class AbstractDoclet implements Doclet {
|
||||
messages.error("doclet.exception.write.file",
|
||||
e.fileName.getPath(), e.getCause());
|
||||
}
|
||||
dumpStack(options.dumpOnError, e);
|
||||
dumpStack(options.dumpOnError(), e);
|
||||
|
||||
} catch (ResourceIOException e) {
|
||||
messages.error("doclet.exception.read.resource",
|
||||
e.resource.getPath(), e.getCause());
|
||||
dumpStack(options.dumpOnError, e);
|
||||
dumpStack(options.dumpOnError(), e);
|
||||
|
||||
} catch (SimpleDocletException e) {
|
||||
configuration.reporter.print(ERROR, e.getMessage());
|
||||
dumpStack(options.dumpOnError, e);
|
||||
dumpStack(options.dumpOnError(), e);
|
||||
|
||||
} catch (InternalException e) {
|
||||
configuration.reporter.print(ERROR, e.getMessage());
|
||||
@ -201,7 +201,7 @@ public abstract class AbstractDoclet implements Doclet {
|
||||
}
|
||||
messages.notice("doclet.build_version",
|
||||
configuration.getDocletVersion());
|
||||
ClassTree classtree = new ClassTree(configuration, configuration.getOptions().noDeprecated);
|
||||
ClassTree classtree = new ClassTree(configuration, configuration.getOptions().noDeprecated());
|
||||
|
||||
generateClassFiles(docEnv, classtree);
|
||||
|
||||
|
@ -232,8 +232,8 @@ public abstract class BaseConfiguration {
|
||||
utils = new Utils(this);
|
||||
|
||||
BaseOptions options = getOptions();
|
||||
if (!options.javafx) {
|
||||
options.javafx = isJavaFXMode();
|
||||
if (!options.javafx()) {
|
||||
options.setJavaFX(isJavaFXMode());
|
||||
}
|
||||
|
||||
// Once docEnv and Utils have been initialized, others should be safe.
|
||||
@ -356,15 +356,15 @@ public abstract class BaseConfiguration {
|
||||
BaseOptions options = getOptions();
|
||||
extern = new Extern(this);
|
||||
initDestDirectory();
|
||||
for (String link : options.linkList) {
|
||||
for (String link : options.linkList()) {
|
||||
extern.link(link, reporter);
|
||||
}
|
||||
for (Pair<String, String> linkOfflinePair : options.linkOfflineList) {
|
||||
for (Pair<String, String> linkOfflinePair : options.linkOfflineList()) {
|
||||
extern.link(linkOfflinePair.first, linkOfflinePair.second, reporter);
|
||||
}
|
||||
typeElementCatalog = new TypeElementCatalog(includedTypeElements, this);
|
||||
initTagletManager(options.customTagStrs);
|
||||
options.groupPairs.stream().forEach((grp) -> {
|
||||
initTagletManager(options.customTagStrs());
|
||||
options.groupPairs().stream().forEach((grp) -> {
|
||||
if (showModules) {
|
||||
group.checkModuleGroups(grp.first, grp.second);
|
||||
} else {
|
||||
@ -391,7 +391,7 @@ public abstract class BaseConfiguration {
|
||||
}
|
||||
|
||||
private void initDestDirectory() throws DocletException {
|
||||
String destDirName = getOptions().destDirName;
|
||||
String destDirName = getOptions().destDirName();
|
||||
if (!destDirName.isEmpty()) {
|
||||
Resources resources = getResources();
|
||||
DocFile destDir = DocFile.createFileForDirectory(this, destDirName);
|
||||
@ -513,7 +513,7 @@ public abstract class BaseConfiguration {
|
||||
* @return true if the directory is excluded.
|
||||
*/
|
||||
public boolean shouldExcludeDocFileDir(String docfilesubdir) {
|
||||
Set<String> excludedDocFileDirs = getOptions().excludedDocFileDirs;
|
||||
Set<String> excludedDocFileDirs = getOptions().excludedDocFileDirs();
|
||||
return excludedDocFileDirs.contains(docfilesubdir);
|
||||
}
|
||||
|
||||
@ -524,7 +524,7 @@ public abstract class BaseConfiguration {
|
||||
* @return true if the qualifier should be excluded
|
||||
*/
|
||||
public boolean shouldExcludeQualifier(String qualifier) {
|
||||
Set<String> excludedQualifiers = getOptions().excludedQualifiers;
|
||||
Set<String> excludedQualifiers = getOptions().excludedQualifiers();
|
||||
if (excludedQualifiers.contains("all") ||
|
||||
excludedQualifiers.contains(qualifier) ||
|
||||
excludedQualifiers.contains(qualifier + ".*")) {
|
||||
@ -564,7 +564,7 @@ public abstract class BaseConfiguration {
|
||||
* @return true if it is a generated doc.
|
||||
*/
|
||||
public boolean isGeneratedDoc(TypeElement te) {
|
||||
boolean nodeprecated = getOptions().noDeprecated;
|
||||
boolean nodeprecated = getOptions().noDeprecated();
|
||||
if (!nodeprecated) {
|
||||
return true;
|
||||
}
|
||||
@ -673,7 +673,7 @@ public abstract class BaseConfiguration {
|
||||
* @return the allowScriptInComments
|
||||
*/
|
||||
public boolean isAllowScriptInComments() {
|
||||
return getOptions().allowScriptInComments;
|
||||
return getOptions().allowScriptInComments();
|
||||
}
|
||||
|
||||
public synchronized VisibleMemberTable getVisibleMemberTable(TypeElement te) {
|
||||
|
@ -52,6 +52,12 @@ import static javax.tools.Diagnostic.Kind.ERROR;
|
||||
* The objects to handle command-line options, and to initialize this
|
||||
* object, are all subtypes of {@link BaseOptions.Option},
|
||||
* returned by {@link BaseOptions#getSupportedOptions()}.
|
||||
*
|
||||
* <p>Some of the methods used to access the values of options
|
||||
* have names that begin with a verb, such as {@link #copyDocfileSubdirs}
|
||||
* or {@link #showVersion}. Unless otherwise stated,
|
||||
* these methods should all be taken as just accessing the value
|
||||
* of the associated option.
|
||||
*/
|
||||
public abstract class BaseOptions {
|
||||
|
||||
@ -61,25 +67,25 @@ public abstract class BaseOptions {
|
||||
* Argument for command-line option {@code --allow-script-in-comments}.
|
||||
* Allow JavaScript in doc comments.
|
||||
*/
|
||||
public boolean allowScriptInComments = false;
|
||||
private boolean allowScriptInComments = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -docfilessubdirs}.
|
||||
* True if we should recursively copy the doc-file subdirectories
|
||||
*/
|
||||
public boolean copyDocfileSubdirs = false;
|
||||
private boolean copyDocfileSubdirs = false;
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -tag} and {@code -taglet}.
|
||||
*/
|
||||
final LinkedHashSet<List<String>> customTagStrs = new LinkedHashSet<>();
|
||||
private final LinkedHashSet<List<String>> customTagStrs = new LinkedHashSet<>();
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -d}.
|
||||
* Destination directory name, in which doclet will generate the entire
|
||||
* documentation. Default is current directory.
|
||||
*/
|
||||
public String destDirName = "";
|
||||
private String destDirName = "";
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --disable-javafx-strict-checks}.
|
||||
@ -87,56 +93,56 @@ public abstract class BaseOptions {
|
||||
* tests allowing those tests to be executed successfully, for
|
||||
* instance, with OpenJDK builds which may not contain FX libraries.
|
||||
*/
|
||||
public boolean disableJavaFxStrictChecks = false;
|
||||
private boolean disableJavaFxStrictChecks = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -docencoding}.
|
||||
* Encoding for this document. Default is default encoding for this
|
||||
* platform.
|
||||
*/
|
||||
public String docEncoding = null;
|
||||
private String docEncoding = null;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code ???}.
|
||||
* Destination directory name, in which doclet will copy the doc-files to.
|
||||
*/
|
||||
public String docFileDestDirName = "";
|
||||
private String docFileDestDirName = "";
|
||||
|
||||
/**
|
||||
* Argument for hidden command-line option {@code --dump-on-error}.
|
||||
*/
|
||||
public boolean dumpOnError = false;
|
||||
private boolean dumpOnError = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -encoding}.
|
||||
* Encoding for this document. Default is default encoding for this
|
||||
* platform.
|
||||
*/
|
||||
public String encoding = null;
|
||||
private String encoding = null;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -excludedocfilessubdir}.
|
||||
* The set of doc-file subdirectories to exclude.
|
||||
*/
|
||||
protected Set<String> excludedDocFileDirs;
|
||||
private Set<String> excludedDocFileDirs;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -noqualifier}.
|
||||
* The set of qualifiers to exclude.
|
||||
*/
|
||||
protected Set<String> excludedQualifiers;
|
||||
private Set<String> excludedQualifiers;
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -group}
|
||||
*/
|
||||
List<Utils.Pair<String, String>> groupPairs;
|
||||
private List<Utils.Pair<String, String>> groupPairs;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --javafx} or {@code -javafx}.
|
||||
* Generate documentation for JavaFX getters and setters automatically
|
||||
* by copying it from the appropriate property definition.
|
||||
*/
|
||||
public boolean javafx = false;
|
||||
private boolean javafx = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -keywords}.
|
||||
@ -144,31 +150,31 @@ public abstract class BaseOptions {
|
||||
* Set to false because meta keywords are ignored in general
|
||||
* by most Internet search engines.
|
||||
*/
|
||||
public boolean keywords = false;
|
||||
private boolean keywords = false;
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -link}.
|
||||
*/
|
||||
// A list containing urls
|
||||
final List<String> linkList = new ArrayList<>();
|
||||
private final List<String> linkList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -linkoffline}.
|
||||
*/
|
||||
// A list of pairs containing urls and package list
|
||||
final List<Utils.Pair<String, String>> linkOfflineList = new ArrayList<>();
|
||||
private final List<Utils.Pair<String, String>> linkOfflineList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -linksource}.
|
||||
* True if we should generate browsable sources.
|
||||
*/
|
||||
public boolean linkSource = false;
|
||||
private boolean linkSource = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nocomment}.
|
||||
* True if user wants to suppress descriptions and tags.
|
||||
*/
|
||||
public boolean noComment = false;
|
||||
private boolean noComment = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nodeprecated}.
|
||||
@ -177,34 +183,34 @@ public abstract class BaseOptions {
|
||||
* -nodeprecated option is used. Default is generate deprecated API
|
||||
* information.
|
||||
*/
|
||||
public boolean noDeprecated = false;
|
||||
private boolean noDeprecated = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nosince}.
|
||||
* True if command-line option "-nosince" is used. Default value is
|
||||
* false.
|
||||
*/
|
||||
public boolean noSince = false;
|
||||
private boolean noSince = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -notimestamp}.
|
||||
* True if user wants to suppress time stamp in output.
|
||||
* Default is false.
|
||||
*/
|
||||
public boolean noTimestamp = false;
|
||||
private boolean noTimestamp = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -quiet}.
|
||||
* Suppress all messages
|
||||
*/
|
||||
public boolean quiet = false;
|
||||
private boolean quiet = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -serialwarn}.
|
||||
* This is true if option "-serialwarn" is used. Default value is false to
|
||||
* suppress excessive warnings about serial tag.
|
||||
*/
|
||||
public boolean serialWarn = false;
|
||||
private boolean serialWarn = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -author}.
|
||||
@ -213,13 +219,13 @@ public abstract class BaseOptions {
|
||||
* <code>showauthor</code> is set to true if -author option is used.
|
||||
* Default is don't show author information.
|
||||
*/
|
||||
public boolean showAuthor = false;
|
||||
private boolean showAuthor = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --show-taglets}.
|
||||
* Show taglets (internal debug switch)
|
||||
*/
|
||||
public boolean showTaglets = false;
|
||||
private boolean showTaglets = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -version}.
|
||||
@ -228,13 +234,13 @@ public abstract class BaseOptions {
|
||||
* used. {@code showVersion} is set to true if -version option is
|
||||
* used. Default is don't show version information.
|
||||
*/
|
||||
public boolean showVersion = false;
|
||||
private boolean showVersion = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -sourcetab}.
|
||||
* The specified amount of space between tab stops.
|
||||
*/
|
||||
public int sourceTabSize;
|
||||
private int sourceTabSize;
|
||||
|
||||
/**
|
||||
* Value for command-line option {@code --override-methods summary}
|
||||
@ -243,13 +249,13 @@ public abstract class BaseOptions {
|
||||
* with no changes to the API contract should be summarized in the
|
||||
* footnote section.
|
||||
*/
|
||||
public boolean summarizeOverriddenMethods = false;
|
||||
private boolean summarizeOverriddenMethods = false;
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -tagletpath}.
|
||||
* The path to Taglets
|
||||
*/
|
||||
public String tagletPath = null;
|
||||
private String tagletPath = null;
|
||||
|
||||
//</editor-fold>
|
||||
|
||||
@ -609,6 +615,265 @@ public abstract class BaseOptions {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --allow-script-in-comments}.
|
||||
* Allow JavaScript in doc comments.
|
||||
*/
|
||||
boolean allowScriptInComments() {
|
||||
return allowScriptInComments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -docfilessubdirs}.
|
||||
* True if we should recursively copy the doc-file subdirectories
|
||||
*/
|
||||
public boolean copyDocfileSubdirs() {
|
||||
return copyDocfileSubdirs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -tag} and {@code -taglet}.
|
||||
*/
|
||||
LinkedHashSet<List<String>> customTagStrs() {
|
||||
return customTagStrs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -d}.
|
||||
* Destination directory name, in which doclet will generate the entire
|
||||
* documentation. Default is current directory.
|
||||
*/
|
||||
String destDirName() {
|
||||
return destDirName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --disable-javafx-strict-checks}.
|
||||
* Primarily used to disable strict checks in the regression
|
||||
* tests allowing those tests to be executed successfully, for
|
||||
* instance, with OpenJDK builds which may not contain FX libraries.
|
||||
*/
|
||||
boolean disableJavaFxStrictChecks() {
|
||||
return disableJavaFxStrictChecks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -docencoding}.
|
||||
* Encoding for this document. Default is default encoding for this
|
||||
* platform.
|
||||
*/
|
||||
public String docEncoding() {
|
||||
return docEncoding;
|
||||
}
|
||||
|
||||
public void setDocEncoding(String docEncoding) {
|
||||
this.docEncoding = docEncoding;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code ???}.
|
||||
* Destination directory name, in which doclet will copy the doc-files to.
|
||||
*/
|
||||
String docFileDestDirName() {
|
||||
return docFileDestDirName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for hidden command-line option {@code --dump-on-error}.
|
||||
*/
|
||||
boolean dumpOnError() {
|
||||
return dumpOnError;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -encoding}.
|
||||
* Encoding for this document. Default is default encoding for this
|
||||
* platform.
|
||||
*/
|
||||
public String encoding() {
|
||||
return encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -excludedocfilessubdir}.
|
||||
* The set of doc-file subdirectories to exclude.
|
||||
*/
|
||||
Set<String> excludedDocFileDirs() {
|
||||
return excludedDocFileDirs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -noqualifier}.
|
||||
* The set of qualifiers to exclude.
|
||||
*/
|
||||
Set<String> excludedQualifiers() {
|
||||
return excludedQualifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -group}
|
||||
*/
|
||||
List<Utils.Pair<String, String>> groupPairs() {
|
||||
return groupPairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --javafx} or {@code -javafx}.
|
||||
* Generate documentation for JavaFX getters and setters automatically
|
||||
* by copying it from the appropriate property definition.
|
||||
*/
|
||||
public boolean javafx() {
|
||||
return javafx;
|
||||
}
|
||||
|
||||
public void setJavaFX(boolean javafx) {
|
||||
this.javafx = javafx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -keywords}.
|
||||
* True if user wants to add member names as meta keywords.
|
||||
* Set to false because meta keywords are ignored in general
|
||||
* by most Internet search engines.
|
||||
*/
|
||||
public boolean keywords() {
|
||||
return keywords;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -link}.
|
||||
*/
|
||||
List<String> linkList() {
|
||||
return linkList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arguments for command-line option {@code -linkoffline}.
|
||||
*/
|
||||
List<Utils.Pair<String, String>> linkOfflineList() {
|
||||
return linkOfflineList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -linksource}.
|
||||
* True if we should generate browsable sources.
|
||||
*/
|
||||
public boolean linkSource() {
|
||||
return linkSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nocomment}.
|
||||
* True if user wants to suppress descriptions and tags.
|
||||
*/
|
||||
public boolean noComment() {
|
||||
return noComment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nodeprecated}.
|
||||
* Don't generate deprecated API information at all if -nodeprecated
|
||||
* option is used. {@code noDeprecated} is set to {@code true} if
|
||||
* {@code -nodeprecated} option is used.
|
||||
* Default is generate deprecated API information.
|
||||
*/
|
||||
public boolean noDeprecated() {
|
||||
return noDeprecated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -nosince}.
|
||||
* True if command-line option {@code -nosince"} is used.
|
||||
* Default value is false.
|
||||
*/
|
||||
public boolean noSince() {
|
||||
return noSince;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -notimestamp}.
|
||||
* True if user wants to suppress time stamp in output.
|
||||
* Default is false.
|
||||
*/
|
||||
public boolean noTimestamp() {
|
||||
return noTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -quiet}.
|
||||
* Suppress all messages
|
||||
*/
|
||||
boolean quiet() {
|
||||
return quiet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -serialwarn}.
|
||||
* This is true if option "-serialwarn" is used. Default value is false to
|
||||
* suppress excessive warnings about serial tag.
|
||||
*/
|
||||
public boolean serialWarn() {
|
||||
return serialWarn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -author}.
|
||||
* Generate author specific information for all the classes if @author
|
||||
* tag is used in the doc comment and if -author option is used.
|
||||
* <code>showauthor</code> is set to true if -author option is used.
|
||||
* Default is don't show author information.
|
||||
*/
|
||||
public boolean showAuthor() {
|
||||
return showAuthor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code --show-taglets}.
|
||||
* Show taglets (internal debug switch)
|
||||
*/
|
||||
public boolean showTaglets() {
|
||||
return showTaglets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -version}.
|
||||
* Generate version specific information for the all the classes
|
||||
* if @version tag is used in the doc comment and if -version option is
|
||||
* used. {@code showVersion} is set to true if -version option is
|
||||
* used. Default is don't show version information.
|
||||
*/
|
||||
public boolean showVersion() {
|
||||
return showVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -sourcetab}.
|
||||
* The specified amount of space between tab stops.
|
||||
*/
|
||||
public int sourceTabSize() {
|
||||
return sourceTabSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Value for command-line option {@code --override-methods summary}
|
||||
* or {@code --override-methods detail}.
|
||||
* Specifies whether those methods that override a super-type's method
|
||||
* with no changes to the API contract should be summarized in the
|
||||
* footnote section.
|
||||
*/
|
||||
public boolean summarizeOverriddenMethods() {
|
||||
return summarizeOverriddenMethods;
|
||||
}
|
||||
|
||||
/**
|
||||
* Argument for command-line option {@code -tagletpath}.
|
||||
* The path to Taglets
|
||||
*/
|
||||
public String tagletPath() {
|
||||
return tagletPath;
|
||||
}
|
||||
|
||||
protected abstract static class Option implements Doclet.Option, Comparable<Option> {
|
||||
private final String[] names;
|
||||
private final String parameters;
|
||||
|
@ -132,7 +132,7 @@ public class Messages {
|
||||
* @param args optional arguments to be replaced in the message.
|
||||
*/
|
||||
public void notice(String key, Object... args) {
|
||||
if (!configuration.getOptions().quiet) {
|
||||
if (!configuration.getOptions().quiet()) {
|
||||
report(NOTE, resources.getText(key, args));
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +31,6 @@ import javax.lang.model.type.TypeKind;
|
||||
import javax.lang.model.type.TypeMirror;
|
||||
import javax.lang.model.util.Types;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.HtmlOptions;
|
||||
|
||||
/**
|
||||
* This class provides basic JavaFX property related utility methods.
|
||||
* Refer to the JavaFX conventions in the VisibleMemberTable comments.
|
||||
@ -49,12 +47,12 @@ public class PropertyUtils {
|
||||
|
||||
PropertyUtils(BaseConfiguration configuration) {
|
||||
BaseOptions options = configuration.getOptions();
|
||||
javafx = options.javafx;
|
||||
javafx = options.javafx();
|
||||
|
||||
typeUtils = configuration.docEnv.getTypeUtils();
|
||||
|
||||
// Disable strict check for JDK's without FX.
|
||||
TypeMirror jboType = options.disableJavaFxStrictChecks
|
||||
TypeMirror jboType = options.disableJavaFxStrictChecks()
|
||||
? null
|
||||
: configuration.utils.getSymbol("javafx.beans.Observable");
|
||||
|
||||
|
@ -181,7 +181,7 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder {
|
||||
* @param annotationDocTree the content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildMemberComments(Content annotationDocTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
writer.addComments(currentMember, annotationDocTree);
|
||||
}
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
|
||||
* @param annotationDocTree the content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildMemberComments(Content annotationDocTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
writer.addComments(currentMember, annotationDocTree);
|
||||
}
|
||||
}
|
||||
|
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java
@ -176,7 +176,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
|
||||
* @param constructorDocTree the content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildConstructorComments(Content constructorDocTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
writer.addComments(currentConstructor, constructorDocTree);
|
||||
}
|
||||
}
|
||||
|
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java
@ -166,7 +166,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
|
||||
* @param enumConstantsTree the content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildEnumConstantComments(Content enumConstantsTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
writer.addComments(currentElement, enumConstantsTree);
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
|
||||
* @param fieldDocTree the content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildFieldComments(Content fieldDocTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
writer.addComments(currentElement, fieldDocTree);
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
|
||||
* @param methodDocTree the content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildMethodComments(Content methodDocTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
ExecutableElement method = currentMethod;
|
||||
if (utils.getFullBody(currentMethod).isEmpty()) {
|
||||
DocFinder.Output docs = DocFinder.search(configuration,
|
||||
|
@ -180,7 +180,7 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
|
||||
* be added
|
||||
*/
|
||||
protected void buildModuleDescription(Content moduleContentTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
moduleWriter.addModuleDescription(moduleContentTree);
|
||||
}
|
||||
}
|
||||
@ -191,7 +191,7 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
|
||||
* @param moduleContentTree the tree to which the module tags will be added
|
||||
*/
|
||||
protected void buildModuleTags(Content moduleContentTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
moduleWriter.addModuleTags(moduleContentTree);
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
SortedSet<TypeElement> ilist = utils.isSpecified(packageElement)
|
||||
? utils.getTypeElementsAsSortedSet(utils.getInterfaces(packageElement))
|
||||
: configuration.typeElementCatalog.interfaces(packageElement);
|
||||
SortedSet<TypeElement> interfaces = utils.filterOutPrivateClasses(ilist, options.javafx);
|
||||
SortedSet<TypeElement> interfaces = utils.filterOutPrivateClasses(ilist, options.javafx());
|
||||
if (!interfaces.isEmpty()) {
|
||||
packageWriter.addInterfaceSummary(interfaces, summaryContentTree);
|
||||
}
|
||||
@ -182,7 +182,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
SortedSet<TypeElement> clist = utils.isSpecified(packageElement)
|
||||
? utils.getTypeElementsAsSortedSet(utils.getOrdinaryClasses(packageElement))
|
||||
: configuration.typeElementCatalog.ordinaryClasses(packageElement);
|
||||
SortedSet<TypeElement> classes = utils.filterOutPrivateClasses(clist, options.javafx);
|
||||
SortedSet<TypeElement> classes = utils.filterOutPrivateClasses(clist, options.javafx());
|
||||
if (!classes.isEmpty()) {
|
||||
packageWriter.addClassSummary(classes, summaryContentTree);
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
SortedSet<TypeElement> elist = utils.isSpecified(packageElement)
|
||||
? utils.getTypeElementsAsSortedSet(utils.getEnums(packageElement))
|
||||
: configuration.typeElementCatalog.enums(packageElement);
|
||||
SortedSet<TypeElement> enums = utils.filterOutPrivateClasses(elist, options.javafx);
|
||||
SortedSet<TypeElement> enums = utils.filterOutPrivateClasses(elist, options.javafx());
|
||||
if (!enums.isEmpty()) {
|
||||
packageWriter.addEnumSummary(enums, summaryContentTree);
|
||||
}
|
||||
@ -214,7 +214,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
SortedSet<TypeElement> rlist = utils.isSpecified(packageElement)
|
||||
? utils.getTypeElementsAsSortedSet(utils.getRecords(packageElement))
|
||||
: configuration.typeElementCatalog.records(packageElement);
|
||||
SortedSet<TypeElement> records = utils.filterOutPrivateClasses(rlist, options.javafx);
|
||||
SortedSet<TypeElement> records = utils.filterOutPrivateClasses(rlist, options.javafx());
|
||||
if (!records.isEmpty()) {
|
||||
packageWriter.addRecordSummary(records, summaryContentTree);
|
||||
}
|
||||
@ -232,7 +232,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
? utils.getTypeElementsAsSortedSet(utils.getExceptions(packageElement))
|
||||
: configuration.typeElementCatalog.exceptions(packageElement);
|
||||
SortedSet<TypeElement> exceptions = utils.filterOutPrivateClasses(iexceptions,
|
||||
options.javafx);
|
||||
options.javafx());
|
||||
if (!exceptions.isEmpty()) {
|
||||
packageWriter.addExceptionSummary(exceptions, summaryContentTree);
|
||||
}
|
||||
@ -249,7 +249,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
utils.isSpecified(packageElement)
|
||||
? utils.getTypeElementsAsSortedSet(utils.getErrors(packageElement))
|
||||
: configuration.typeElementCatalog.errors(packageElement);
|
||||
SortedSet<TypeElement> errors = utils.filterOutPrivateClasses(ierrors, options.javafx);
|
||||
SortedSet<TypeElement> errors = utils.filterOutPrivateClasses(ierrors, options.javafx());
|
||||
if (!errors.isEmpty()) {
|
||||
packageWriter.addErrorSummary(errors, summaryContentTree);
|
||||
}
|
||||
@ -267,7 +267,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
? utils.getTypeElementsAsSortedSet(utils.getAnnotationTypes(packageElement))
|
||||
: configuration.typeElementCatalog.annotationTypes(packageElement);
|
||||
SortedSet<TypeElement> annotationTypes = utils.filterOutPrivateClasses(iannotationTypes,
|
||||
options.javafx);
|
||||
options.javafx());
|
||||
if (!annotationTypes.isEmpty()) {
|
||||
packageWriter.addAnnotationTypeSummary(annotationTypes, summaryContentTree);
|
||||
}
|
||||
@ -280,7 +280,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
* be added
|
||||
*/
|
||||
protected void buildPackageDescription(Content packageContentTree) {
|
||||
if (options.noComment) {
|
||||
if (options.noComment()) {
|
||||
return;
|
||||
}
|
||||
packageWriter.addPackageDescription(packageContentTree);
|
||||
@ -292,7 +292,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
|
||||
* @param packageContentTree the tree to which the package tags will be added
|
||||
*/
|
||||
protected void buildPackageTags(Content packageContentTree) {
|
||||
if (options.noComment) {
|
||||
if (options.noComment()) {
|
||||
return;
|
||||
}
|
||||
packageWriter.addPackageTags(packageContentTree);
|
||||
|
@ -165,7 +165,7 @@ public class PropertyBuilder extends AbstractMemberBuilder {
|
||||
* @param propertyDocTree the content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildPropertyComments(Content propertyDocTree) {
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
writer.addComments(currentProperty, propertyDocTree);
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
|
||||
* @throws DocletException if there is a problem while building the documentation
|
||||
*/
|
||||
protected void buildMethodInfo(Content methodsContentTree) throws DocletException {
|
||||
if (options.noComment) {
|
||||
if (options.noComment()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
|
||||
ExecutableElement method = (ExecutableElement)currentMember;
|
||||
if (method.getSimpleName().toString().compareTo("writeExternal") == 0
|
||||
&& utils.getSerialDataTrees(method).isEmpty()) {
|
||||
if (options.serialWarn) {
|
||||
if (options.serialWarn()) {
|
||||
TypeElement encl = (TypeElement) method.getEnclosingElement();
|
||||
messages.warning(currentMember,
|
||||
"doclet.MissingSerialDataTag", encl.getQualifiedName().toString(),
|
||||
@ -386,7 +386,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
|
||||
Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader();
|
||||
Content fieldsOverviewContentTree = fieldWriter.getFieldsContentHeader(true);
|
||||
fieldWriter.addMemberDeprecatedInfo(ve, fieldsOverviewContentTree);
|
||||
if (!options.noComment) {
|
||||
if (!options.noComment()) {
|
||||
fieldWriter.addMemberDescription(ve, fieldsOverviewContentTree);
|
||||
fieldWriter.addMemberTags(ve, fieldsOverviewContentTree);
|
||||
}
|
||||
@ -462,7 +462,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
|
||||
* @param serializableFieldsTree content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildSerialFieldTagsInfo(Content serializableFieldsTree) {
|
||||
if (options.noComment) {
|
||||
if (options.noComment()) {
|
||||
return;
|
||||
}
|
||||
VariableElement field = (VariableElement)currentMember;
|
||||
@ -509,14 +509,14 @@ public class SerializedFormBuilder extends AbstractBuilder {
|
||||
* @param fieldsContentTree content tree to which the documentation will be added
|
||||
*/
|
||||
protected void buildFieldInfo(Content fieldsContentTree) {
|
||||
if (options.noComment) {
|
||||
if (options.noComment()) {
|
||||
return;
|
||||
}
|
||||
VariableElement field = (VariableElement)currentMember;
|
||||
TypeElement te = utils.getEnclosingTypeElement(currentMember);
|
||||
// Process default Serializable field.
|
||||
if ((utils.getSerialTrees(field).isEmpty()) /*&& !field.isSynthetic()*/
|
||||
&& options.serialWarn) {
|
||||
&& options.serialWarn()) {
|
||||
messages.warning(field,
|
||||
"doclet.MissingSerialTag", utils.getFullyQualifiedName(te),
|
||||
utils.getSimpleName(field));
|
||||
|
@ -192,17 +192,17 @@ public class TagletManager {
|
||||
unseenCustomTags = new HashSet<>();
|
||||
allTaglets = new LinkedHashMap<>();
|
||||
BaseOptions options = configuration.getOptions();
|
||||
this.nosince = options.noSince;
|
||||
this.showversion = options.showVersion;
|
||||
this.showauthor = options.showAuthor;
|
||||
this.javafx = options.javafx;
|
||||
this.nosince = options.noSince();
|
||||
this.showversion = options.showVersion();
|
||||
this.showauthor = options.showAuthor();
|
||||
this.javafx = options.javafx();
|
||||
this.docEnv = configuration.docEnv;
|
||||
this.doclet = configuration.doclet;
|
||||
this.messages = configuration.getMessages();
|
||||
this.resources = configuration.getResources();
|
||||
this.showTaglets = options.showTaglets;
|
||||
this.showTaglets = options.showTaglets();
|
||||
this.utils = configuration.utils;
|
||||
this.tagletPath = options.tagletPath;
|
||||
this.tagletPath = options.tagletPath();
|
||||
initStandardTaglets();
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class ClassTree {
|
||||
// In the tree page (e.g overview-tree.html) do not include
|
||||
// information of classes which are deprecated or are a part of a
|
||||
// deprecated package.
|
||||
if (configuration.getOptions().noDeprecated &&
|
||||
if (configuration.getOptions().noDeprecated() &&
|
||||
(utils.isDeprecated(aClass) ||
|
||||
utils.isDeprecated(utils.containingPackage(aClass)))) {
|
||||
continue;
|
||||
|
@ -77,7 +77,7 @@ public class ElementListWriter {
|
||||
try (BufferedWriter out = new BufferedWriter(file.openWriter())) {
|
||||
if (configuration.showModules) {
|
||||
for (ModuleElement mdle : configuration.modulePackages.keySet()) {
|
||||
if (!(options.noDeprecated && utils.isDeprecated(mdle))) {
|
||||
if (!(options.noDeprecated() && utils.isDeprecated(mdle))) {
|
||||
out.write(DocletConstants.MODULE_PREFIX + mdle.toString());
|
||||
out.newLine();
|
||||
for (PackageElement pkg : configuration.modulePackages.get(mdle)) {
|
||||
@ -90,7 +90,7 @@ public class ElementListWriter {
|
||||
for (PackageElement pkg : configuration.packages) {
|
||||
// if the -nodeprecated option is set and the package is marked as
|
||||
// deprecated, do not include it in the packages list.
|
||||
if (!(options.noDeprecated && utils.isDeprecated(pkg))) {
|
||||
if (!(options.noDeprecated() && utils.isDeprecated(pkg))) {
|
||||
out.write(pkg.toString());
|
||||
out.newLine();
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public class IndexBuilder {
|
||||
|
||||
this.noDeprecated = noDeprecated;
|
||||
this.classesOnly = classesOnly;
|
||||
this.javafx = configuration.getOptions().javafx;
|
||||
this.javafx = configuration.getOptions().javafx();
|
||||
this.indexmap = new TreeMap<>();
|
||||
comparator = classesOnly
|
||||
? utils.makeAllClassesComparator()
|
||||
|
@ -78,7 +78,7 @@ public class MetaKeywords {
|
||||
ArrayList<String> results = new ArrayList<>();
|
||||
|
||||
// Add field and method keywords only if -keywords option is used
|
||||
if (options.keywords) {
|
||||
if (options.keywords()) {
|
||||
results.addAll(getClassKeyword(typeElement));
|
||||
results.addAll(getMemberKeywords(utils.getFields(typeElement)));
|
||||
results.addAll(getMemberKeywords(utils.getMethods(typeElement)));
|
||||
@ -103,7 +103,7 @@ public class MetaKeywords {
|
||||
*/
|
||||
public List<String> getMetaKeywords(PackageElement packageElement) {
|
||||
List<String> result = new ArrayList<>(1);
|
||||
if (options.keywords) {
|
||||
if (options.keywords()) {
|
||||
String pkgName = utils.getPackageName(packageElement);
|
||||
result.add(pkgName + " " + "package");
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class MetaKeywords {
|
||||
* @param mdle the module being documented
|
||||
*/
|
||||
public List<String> getMetaKeywordsForModule(ModuleElement mdle) {
|
||||
if (options.keywords) {
|
||||
if (options.keywords()) {
|
||||
return Arrays.asList(mdle.getQualifiedName() + " " + "module");
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
@ -128,7 +128,7 @@ public class MetaKeywords {
|
||||
*/
|
||||
public List<String> getOverviewMetaKeywords(String title, String docTitle) {
|
||||
List<String> result = new ArrayList<>(1);
|
||||
if (options.keywords) {
|
||||
if (options.keywords()) {
|
||||
String windowOverview = resources.getText(title);
|
||||
if (docTitle.length() > 0) {
|
||||
result.add(windowOverview + ", " + docTitle);
|
||||
|
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java
2
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java
@ -207,7 +207,7 @@ class StandardDocFileFactory extends DocFileFactory {
|
||||
|
||||
try {
|
||||
OutputStream out = getFileObjectForOutput(path).openOutputStream();
|
||||
String docencoding = configuration.getOptions().docEncoding;
|
||||
String docencoding = configuration.getOptions().docEncoding();
|
||||
return new BufferedWriter(new OutputStreamWriter(out, docencoding));
|
||||
} catch (IOException e) {
|
||||
throw new DocFileIOException(this, DocFileIOException.Mode.WRITE, e);
|
||||
|
@ -162,7 +162,7 @@ public class TypeElementCatalog {
|
||||
private void addTypeElement(TypeElement typeElement, Map<PackageElement, SortedSet<TypeElement>> map) {
|
||||
|
||||
PackageElement pkg = utils.containingPackage(typeElement);
|
||||
if (utils.isSpecified(pkg) || configuration.getOptions().noDeprecated && utils.isDeprecated(pkg)) {
|
||||
if (utils.isSpecified(pkg) || configuration.getOptions().noDeprecated() && utils.isDeprecated(pkg)) {
|
||||
// No need to catalog this class if it's package is
|
||||
// specified on the command line or if -nodeprecated option is set
|
||||
return;
|
||||
|
@ -393,7 +393,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
public boolean isProperty(String name) {
|
||||
return options.javafx && name.endsWith("Property");
|
||||
return options.javafx() && name.endsWith("Property");
|
||||
}
|
||||
|
||||
public String getPropertyName(String name) {
|
||||
@ -1390,7 +1390,7 @@ public class Utils {
|
||||
if (!text.contains("\t"))
|
||||
return text;
|
||||
|
||||
final int tabLength = options.sourceTabSize;
|
||||
final int tabLength = options.sourceTabSize();
|
||||
final String whitespace = " ".repeat(tabLength);
|
||||
final int textLength = text.length();
|
||||
StringBuilder result = new StringBuilder(textLength);
|
||||
@ -1523,7 +1523,7 @@ public class Utils {
|
||||
if (!isIncluded(e)) {
|
||||
return false;
|
||||
}
|
||||
if (options.javafx &&
|
||||
if (options.javafx() &&
|
||||
hasBlockTag(e, DocTree.Kind.UNKNOWN_BLOCK_TAG, "treatAsPrivate")) {
|
||||
return true;
|
||||
}
|
||||
@ -1536,8 +1536,7 @@ public class Utils {
|
||||
* @return true if there are no comments, false otherwise
|
||||
*/
|
||||
public boolean isSimpleOverride(ExecutableElement m) {
|
||||
if (!options.summarizeOverriddenMethods ||
|
||||
!isIncluded(m)) {
|
||||
if (!options.summarizeOverriddenMethods() || !isIncluded(m)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -661,7 +661,7 @@ public class VisibleMemberTable {
|
||||
|
||||
List<? extends Element> elements = te.getEnclosedElements();
|
||||
for (Element e : elements) {
|
||||
if (options.noDeprecated && utils.isDeprecated(e)) {
|
||||
if (options.noDeprecated() && utils.isDeprecated(e)) {
|
||||
continue;
|
||||
}
|
||||
switch (e.getKind()) {
|
||||
@ -803,7 +803,7 @@ public class VisibleMemberTable {
|
||||
* {@code boolean isFoo()}
|
||||
*/
|
||||
private void computeVisibleProperties(LocalMemberTable lmt) {
|
||||
if (!options.javafx)
|
||||
if (!options.javafx())
|
||||
return;
|
||||
|
||||
PropertyUtils pUtils = config.propertyUtils;
|
||||
|
@ -49,6 +49,12 @@ import static jdk.javadoc.internal.tool.ToolOptions.ToolOption.Kind.*;
|
||||
* the source level, and path options to locate the files to be
|
||||
* documented.
|
||||
*
|
||||
* <p>Some of the methods used to access the values of options
|
||||
* have names that begin with a verb, such as {@link #expandRequires}
|
||||
* or {@link #ignoreSourceErrors}. Unless otherwise stated,
|
||||
* these methods should all be taken as just accessing the value
|
||||
* of the associated option.
|
||||
*
|
||||
* <p><b>This is NOT part of any supported API.
|
||||
* If you write code that depends on this, you do so at your own risk.
|
||||
* This code and its internal interfaces are subject to change or
|
||||
|
Loading…
x
Reference in New Issue
Block a user