--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -79,7 +79,7 @@
* @param path Path to the file which is getting generated.
* @param indexbuilder Unicode based Index from {@link IndexBuilder}
*/
- protected AbstractIndexWriter(ConfigurationImpl configuration,
+ protected AbstractIndexWriter(HtmlConfiguration configuration,
DocPath path,
IndexBuilder indexbuilder) {
super(configuration, path);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
*/
public abstract class AbstractMemberWriter {
- protected final ConfigurationImpl configuration;
+ protected final HtmlConfiguration configuration;
protected final Utils utils;
protected final SubWriterHolderWriter writer;
protected final Contents contents;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractModuleIndexWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@
* @param configuration The current configuration
* @param filename Name of the module index file to be generated.
*/
- public AbstractModuleIndexWriter(ConfigurationImpl configuration,
+ public AbstractModuleIndexWriter(HtmlConfiguration configuration,
DocPath filename) {
super(configuration, filename);
modules = configuration.modulePackages;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractPackageIndexWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -64,7 +64,7 @@
* @param configuration The current configuration
* @param filename Name of the package index file to be generated.
*/
- public AbstractPackageIndexWriter(ConfigurationImpl configuration,
+ public AbstractPackageIndexWriter(HtmlConfiguration configuration,
DocPath filename) {
super(configuration, filename);
packages = configuration.packages;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
* @param filename File to be generated.
* @param classtree Tree built by {@link ClassTree}.
*/
- protected AbstractTreeWriter(ConfigurationImpl configuration,
+ protected AbstractTreeWriter(HtmlConfiguration configuration,
DocPath filename, ClassTree classtree) {
super(configuration, filename);
this.classtree = classtree;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
* @param filename Path to the file which is getting generated.
* @param indexbuilder Unicode based Index from {@link IndexBuilder}
*/
- public AllClassesFrameWriter(ConfigurationImpl configuration,
+ public AllClassesFrameWriter(HtmlConfiguration configuration,
DocPath filename, IndexBuilder indexbuilder) {
super(configuration, filename);
this.indexbuilder = indexbuilder;
@@ -88,7 +88,7 @@
* @param indexBuilder IndexBuilder object for all classes index.
* @throws DocFileIOException
*/
- public static void generate(ConfigurationImpl configuration,
+ public static void generate(HtmlConfiguration configuration,
IndexBuilder indexBuilder) throws DocFileIOException {
if (configuration.frames) {
generate(configuration, indexBuilder, DocPaths.ALLCLASSES_FRAME, true);
@@ -98,8 +98,8 @@
}
}
- private static void generate(ConfigurationImpl configuration, IndexBuilder indexBuilder,
- DocPath fileName, boolean wantFrames) throws DocFileIOException {
+ private static void generate(HtmlConfiguration configuration, IndexBuilder indexBuilder,
+ DocPath fileName, boolean wantFrames) throws DocFileIOException {
AllClassesFrameWriter allclassgen = new AllClassesFrameWriter(configuration,
fileName, indexBuilder);
allclassgen.buildAllClassesFile(wantFrames);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -79,7 +79,7 @@
* @param prevType the previous class that was documented.
* @param nextType the next class being documented.
*/
- public AnnotationTypeWriterImpl(ConfigurationImpl configuration,
+ public AnnotationTypeWriterImpl(HtmlConfiguration configuration,
TypeElement annotationType, TypeMirror prevType, TypeMirror nextType) {
super(configuration, DocPath.forClass(configuration.utils, annotationType));
this.annotationType = annotationType;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -112,7 +112,7 @@
*
* @param filename the file to be generated.
*/
- public ClassUseWriter(ConfigurationImpl configuration,
+ public ClassUseWriter(HtmlConfiguration configuration,
ClassUseMapper mapper, DocPath filename,
TypeElement typeElement) {
super(configuration, filename);
@@ -177,7 +177,7 @@
* @param classtree the class tree hierarchy
* @throws DocFileIOException if there is an error while generating the documentation
*/
- public static void generate(ConfigurationImpl configuration, ClassTree classtree) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration, ClassTree classtree) throws DocFileIOException {
ClassUseMapper mapper = new ClassUseMapper(configuration, classtree);
for (TypeElement aClass : configuration.getIncludedTypeElements()) {
// If -nodeprecated option is set and the containing package is marked
@@ -220,7 +220,7 @@
*
* @throws DocFileIOException if there is a problem while generating the documentation
*/
- public static void generate(ConfigurationImpl configuration, ClassUseMapper mapper,
+ public static void generate(HtmlConfiguration configuration, ClassUseMapper mapper,
TypeElement typeElement) throws DocFileIOException {
ClassUseWriter clsgen;
DocPath path = DocPath.forPackage(configuration.utils, typeElement)
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -89,8 +89,8 @@
* @param nextClass the next class being documented.
* @param classTree the class tree for the given class.
*/
- public ClassWriterImpl(ConfigurationImpl configuration, TypeElement typeElement,
- TypeElement prevClass, TypeElement nextClass, ClassTree classTree) {
+ public ClassWriterImpl(HtmlConfiguration configuration, TypeElement typeElement,
+ TypeElement prevClass, TypeElement nextClass, ClassTree classTree) {
super(configuration, DocPath.forClass(configuration.utils, typeElement));
this.typeElement = typeElement;
configuration.currentTypeElement = typeElement;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,790 +0,0 @@
-/*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.javadoc.internal.doclets.formats.html;
-
-import java.net.*;
-import java.util.*;
-
-import javax.lang.model.element.Element;
-import javax.lang.model.element.PackageElement;
-import javax.lang.model.element.TypeElement;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardJavaFileManager;
-
-import com.sun.source.util.DocTreePath;
-import com.sun.tools.doclint.DocLint;
-
-import jdk.javadoc.doclet.Doclet;
-import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
-import jdk.javadoc.internal.doclets.formats.html.markup.HtmlVersion;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
-import jdk.javadoc.internal.doclets.toolkit.Content;
-import jdk.javadoc.internal.doclets.toolkit.Messages;
-import jdk.javadoc.internal.doclets.toolkit.Resources;
-import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
-import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
-import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
-import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
-import jdk.javadoc.internal.doclets.toolkit.util.Utils;
-
-import static javax.tools.Diagnostic.Kind.*;
-
-/**
- * Configure the output based on the command line options.
- * <p>
- * Also determine the length of the command line option. For example,
- * for a option "-header" there will be a string argument associated, then the
- * the length of option "-header" is two. But for option "-nohelp" no argument
- * is needed so it's length is 1.
- * </p>
- * <p>
- * Also do the error checking on the options used. For example it is illegal to
- * use "-helpfile" option when already "-nohelp" option is used.
- * </p>
- *
- * <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
- * deletion without notice.</b>
- *
- * @author Robert Field.
- * @author Atul Dambalkar.
- * @author Jamie Ho
- * @author Bhavesh Patel (Modified)
- */
-public class ConfigurationImpl extends Configuration {
-
- /**
- * The build date. Note: For now, we will use
- * a version number instead of a date.
- */
- public static final String BUILD_DATE = System.getProperty("java.version");
-
- /**
- * Argument for command line option "-header".
- */
- public String header = "";
-
- /**
- * Argument for command line option "-packagesheader".
- */
- public String packagesheader = "";
-
- /**
- * Argument for command line option "-footer".
- */
- public String footer = "";
-
- /**
- * Argument for command line option "-doctitle".
- */
- public String doctitle = "";
-
- /**
- * Argument for command line option "-windowtitle".
- */
- public String windowtitle = "";
-
- /**
- * Argument for command line option "-top".
- */
- public String top = "";
-
- /**
- * Argument for command line option "-bottom".
- */
- public String bottom = "";
-
- /**
- * Argument for command line option "-helpfile".
- */
- public String helpfile = "";
-
- /**
- * Argument for command line option "-stylesheetfile".
- */
- public String stylesheetfile = "";
-
- /**
- * Argument for command line option "-Xdocrootparent".
- */
- public String docrootparent = "";
-
- /**
- * True if command line option "-nohelp" is used. Default value is false.
- */
- public boolean nohelp = false;
-
- /**
- * True if command line option "-splitindex" is used. Default value is
- * false.
- */
- public boolean splitindex = false;
-
- /**
- * False if command line option "-noindex" is used. Default value is true.
- */
- public boolean createindex = true;
-
- /**
- * True if command line option "-use" is used. Default value is false.
- */
- public boolean classuse = false;
-
- /**
- * False if command line option "-notree" is used. Default value is true.
- */
- public boolean createtree = true;
-
- /**
- * True if command line option "-nodeprecated" is used. Default value is
- * false.
- */
- public boolean nodeprecatedlist = false;
-
- /**
- * True if command line option "-nonavbar" is used. Default value is false.
- */
- public boolean nonavbar = false;
-
- /**
- * True if command line option "-nooverview" is used. Default value is
- * false
- */
- private boolean nooverview = false;
-
- /**
- * The overview path specified with "-overview" flag.
- */
- public String overviewpath = null;
-
- /**
- * 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;
-
- /**
- * Specifies whether or not frames should be generated.
- * Defaults to true; can be set by --frames; can be set to false by --no-frames; last one wins.
- */
- public boolean frames = true;
-
- /**
- * This is the HTML version of the generated pages. HTML 4.01 is the default output version.
- */
- public HtmlVersion htmlVersion = HtmlVersion.HTML4;
-
- /**
- * Collected set of doclint options
- */
- public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
-
- public final Resources resources;
-
- /**
- * First file to appear in the right-hand frame in the generated
- * documentation.
- */
- public DocPath topFile = DocPath.empty;
-
- /**
- * The TypeElement for the class file getting generated.
- */
- public TypeElement currentTypeElement = null; // Set this TypeElement in the ClassWriter.
-
- protected List<SearchIndexItem> memberSearchIndex = new ArrayList<>();
-
- protected List<SearchIndexItem> moduleSearchIndex = new ArrayList<>();
-
- protected List<SearchIndexItem> packageSearchIndex = new ArrayList<>();
-
- protected List<SearchIndexItem> tagSearchIndex = new ArrayList<>();
-
- protected List<SearchIndexItem> typeSearchIndex = new ArrayList<>();
-
- protected Map<Character,List<SearchIndexItem>> tagSearchIndexMap = new HashMap<>();
-
- protected Set<Character> tagSearchIndexKeys;
-
- protected Contents contents;
-
- protected Messages messages;
-
- /**
- * Constructor. Initializes resource for the
- * {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}.
- */
- public ConfigurationImpl(Doclet doclet) {
- super(doclet);
- resources = new Resources(this,
- Configuration.sharedResourceBundleName,
- "jdk.javadoc.internal.doclets.formats.html.resources.standard");
-
- messages = new Messages(this);
- contents = new Contents(this);
- }
-
- private final String versionRBName = "jdk.javadoc.internal.tool.resources.version";
- private ResourceBundle versionRB;
-
- /**
- * Return the build date for the doclet.
- * @return the build date
- */
- @Override
- public String getDocletSpecificBuildDate() {
- if (versionRB == null) {
- try {
- versionRB = ResourceBundle.getBundle(versionRBName, getLocale());
- } catch (MissingResourceException e) {
- return BUILD_DATE;
- }
- }
-
- try {
- return versionRB.getString("release");
- } catch (MissingResourceException e) {
- return BUILD_DATE;
- }
- }
-
- @Override
- public Resources getResources() {
- return resources;
- }
-
- @Override
- public Messages getMessages() {
- return messages;
- }
-
- protected boolean validateOptions() {
- // check shared options
- if (!generalValidOptions()) {
- return false;
- }
- // check if helpfile exists
- if (!helpfile.isEmpty()) {
- DocFile help = DocFile.createFileForInput(this, helpfile);
- if (!help.exists()) {
- reporter.print(ERROR, getText("doclet.File_not_found", helpfile));
- return false;
- }
- }
-
- // In a more object-oriented world, this would be done by methods on the Option objects.
- // Note that -windowtitle silently removes any and all HTML elements, and so does not need
- // to be handled here.
- utils.checkJavaScriptInOption("-header", header);
- utils.checkJavaScriptInOption("-footer", footer);
- utils.checkJavaScriptInOption("-top", top);
- utils.checkJavaScriptInOption("-bottom", bottom);
- utils.checkJavaScriptInOption("-doctitle", doctitle);
- utils.checkJavaScriptInOption("-packagesheader", packagesheader);
-
- return true;
- }
-
-
- @Override
- public boolean finishOptionSettings() {
- if (!validateOptions()) {
- return false;
- }
- if (!getSpecifiedTypeElements().isEmpty()) {
- Map<String, PackageElement> map = new HashMap<>();
- PackageElement pkg;
- for (TypeElement aClass : getIncludedTypeElements()) {
- pkg = utils.containingPackage(aClass);
- if (!map.containsKey(utils.getPackageName(pkg))) {
- map.put(utils.getPackageName(pkg), pkg);
- }
- }
- }
- setCreateOverview();
- setTopFile(docEnv);
- workArounds.initDocLint(doclintOpts.values(), tagletManager.getCustomTagNames(),
- Utils.toLowerCase(htmlVersion.name()));
- return true;
- }
-
- /**
- * Return true if the generated output is HTML5.
- */
- public boolean isOutputHtml5() {
- return htmlVersion == HtmlVersion.HTML5;
- }
-
- /**
- * Return true if the tag is allowed for this specific version of HTML.
- */
- public boolean allowTag(HtmlTag htmlTag) {
- return htmlTag.allowTag(this.htmlVersion);
- }
-
- /**
- * Decide the page which will appear first in the right-hand frame. It will
- * be "overview-summary.html" if "-overview" option is used or no
- * "-overview" but the number of packages is more than one. It will be
- * "package-summary.html" of the respective package if there is only one
- * package to document. It will be a class page(first in the sorted order),
- * if only classes are provided on the command line.
- *
- * @param docEnv the doclet environment
- */
- protected void setTopFile(DocletEnvironment docEnv) {
- if (!checkForDeprecation(docEnv)) {
- return;
- }
- if (createoverview) {
- topFile = DocPaths.overviewSummary(frames);
- } else {
- if (showModules) {
- topFile = DocPath.empty.resolve(DocPaths.moduleSummary(modules.first()));
- } else if (packages.size() == 1 && packages.first().isUnnamed()) {
- List<TypeElement> classes = new ArrayList<>(getIncludedTypeElements());
- if (!classes.isEmpty()) {
- TypeElement te = getValidClass(classes);
- topFile = DocPath.forClass(utils, te);
- }
- } else if (!packages.isEmpty()) {
- topFile = DocPath.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY);
- }
- }
- }
-
- protected TypeElement getValidClass(List<TypeElement> classes) {
- if (!nodeprecated) {
- return classes.get(0);
- }
- for (TypeElement te : classes) {
- if (!utils.isDeprecated(te)) {
- return te;
- }
- }
- return null;
- }
-
- protected boolean checkForDeprecation(DocletEnvironment docEnv) {
- for (TypeElement te : getIncludedTypeElements()) {
- if (isGeneratedDoc(te)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Generate "overview.html" page if option "-overview" is used or number of
- * packages is more than one. Sets {@link #createoverview} field to true.
- */
- protected void setCreateOverview() {
- if ((overviewpath != null || packages.size() > 1) && !nooverview) {
- createoverview = true;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public WriterFactory getWriterFactory() {
- return new WriterFactoryImpl(this);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Locale getLocale() {
- if (locale == null)
- return Locale.getDefault();
- return locale;
- }
-
- /**
- * Return the path of the overview file or null if it does not exist.
- *
- * @return the path of the overview file or null if it does not exist.
- */
- @Override
- public JavaFileObject getOverviewPath() {
- if (overviewpath != null && getFileManager() instanceof StandardJavaFileManager) {
- StandardJavaFileManager fm = (StandardJavaFileManager) getFileManager();
- return fm.getJavaFileObjects(overviewpath).iterator().next();
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public JavaFileManager getFileManager() {
- return docEnv.getJavaFileManager();
- }
-
- @Override
- public boolean showMessage(DocTreePath path, String key) {
- return (path == null || workArounds.haveDocLint());
- }
-
- @Override
- public boolean showMessage(Element e, String key) {
- return (e == null || workArounds.haveDocLint());
- }
-
- @Override
- public String getText(String key) {
- return resources.getText(key);
- }
-
- @Override
- public String getText(String key, String... args) {
- return resources.getText(key, (Object[]) args);
- }
-
- /**
- * {@inheritdoc}
- */
- @Override
- public Content getContent(String key) {
- return contents.getContent(key);
- }
-
- /**
- * Get the configuration string as a content.
- *
- * @param key the key to look for in the configuration file
- * @param o string or content argument added to configuration text
- * @return a content tree for the text
- */
- @Override
- public Content getContent(String key, Object o) {
- return contents.getContent(key, o);
- }
-
- /**
- * Get the configuration string as a content.
- *
- * @param key the key to look for in the configuration file
- * @param o1 resource argument
- * @param o2 resource argument
- * @return a content tree for the text
- */
- @Override
- public Content getContent(String key, Object o1, Object o2) {
- return contents.getContent(key, o1, o2);
- }
-
- /**
- * Get the configuration string as a content.
- *
- * @param key the key to look for in the configuration file
- * @param o0 string or content argument added to configuration text
- * @param o1 string or content argument added to configuration text
- * @param o2 string or content argument added to configuration text
- * @return a content tree for the text
- */
- @Override
- public Content getContent(String key, Object o0, Object o1, Object o2) {
- return contents.getContent(key, o0, o1, o2);
- }
-
- protected void buildSearchTagIndex() {
- for (SearchIndexItem sii : tagSearchIndex) {
- String tagLabel = sii.getLabel();
- Character unicode = (tagLabel.length() == 0)
- ? '*'
- : Character.toUpperCase(tagLabel.charAt(0));
- List<SearchIndexItem> list = tagSearchIndexMap.get(unicode);
- if (list == null) {
- list = new ArrayList<>();
- tagSearchIndexMap.put(unicode, list);
- }
- list.add(sii);
- }
- tagSearchIndexKeys = tagSearchIndexMap.keySet();
- }
-
- @Override
- public Set<Doclet.Option> getSupportedOptions() {
- Resources resources = getResources();
- Doclet.Option[] options = {
- new Option(resources, "-bottom", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- bottom = args.get(0);
- return true;
- }
- },
- new Option(resources, "-charset", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- charset = args.get(0);
- return true;
- }
- },
- new Option(resources, "-doctitle", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- doctitle = args.get(0);
- return true;
- }
- },
- new Option(resources, "-footer", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- footer = args.get(0);
- return true;
- }
- },
- new Option(resources, "-header", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- header = args.get(0);
- return true;
- }
- },
- new Option(resources, "-helpfile", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- if (nohelp == true) {
- reporter.print(ERROR, getText("doclet.Option_conflict",
- "-helpfile", "-nohelp"));
- return false;
- }
- if (!helpfile.isEmpty()) {
- reporter.print(ERROR, getText("doclet.Option_reuse",
- "-helpfile"));
- return false;
- }
- helpfile = args.get(0);
- return true;
- }
- },
- new Option(resources, "-html4") {
- @Override
- public boolean process(String opt, List<String> args) {
- htmlVersion = HtmlVersion.HTML4;
- return true;
- }
- },
- new Option(resources, "-html5") {
- @Override
- public boolean process(String opt, List<String> args) {
- htmlVersion = HtmlVersion.HTML5;
- return true;
- }
- },
- new Option(resources, "-nohelp") {
- @Override
- public boolean process(String opt, List<String> args) {
- nohelp = true;
- if (!helpfile.isEmpty()) {
- reporter.print(ERROR, getText("doclet.Option_conflict",
- "-nohelp", "-helpfile"));
- return false;
- }
- return true;
- }
- },
- new Option(resources, "-nodeprecatedlist") {
- @Override
- public boolean process(String opt, List<String> args) {
- nodeprecatedlist = true;
- return true;
- }
- },
- new Option(resources, "-noindex") {
- @Override
- public boolean process(String opt, List<String> args) {
- createindex = false;
- if (splitindex == true) {
- reporter.print(ERROR, getText("doclet.Option_conflict",
- "-noindex", "-splitindex"));
- return false;
- }
- return true;
- }
- },
- new Option(resources, "-nonavbar") {
- @Override
- public boolean process(String opt, List<String> args) {
- nonavbar = true;
- return true;
- }
- },
- new Hidden(resources, "-nooverview") {
- @Override
- public boolean process(String opt, List<String> args) {
- nooverview = true;
- if (overviewpath != null) {
- reporter.print(ERROR, getText("doclet.Option_conflict",
- "-nooverview", "-overview"));
- return false;
- }
- return true;
- }
- },
- new Option(resources, "-notree") {
- @Override
- public boolean process(String opt, List<String> args) {
- createtree = false;
- return true;
- }
- },
- new Option(resources, "-overview", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- overviewpath = args.get(0);
- if (nooverview == true) {
- reporter.print(ERROR, getText("doclet.Option_conflict",
- "-overview", "-nooverview"));
- return false;
- }
- return true;
- }
- },
- new Option(resources, "--frames") {
- @Override
- public boolean process(String opt, List<String> args) {
- frames = true;
- return true;
- }
- },
- new Option(resources, "--no-frames") {
- @Override
- public boolean process(String opt, List<String> args) {
- frames = false;
- return true;
- }
- },
- new Hidden(resources, "-packagesheader", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- packagesheader = args.get(0);
- return true;
- }
- },
- new Option(resources, "-splitindex") {
- @Override
- public boolean process(String opt, List<String> args) {
- splitindex = true;
- if (createindex == false) {
- reporter.print(ERROR, getText("doclet.Option_conflict",
- "-splitindex", "-noindex"));
- return false;
- }
- return true;
- }
- },
- new Option(resources, "-stylesheetfile", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- stylesheetfile = args.get(0);
- return true;
- }
- },
- new Option(resources, "-top", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- top = args.get(0);
- return true;
- }
- },
- new Option(resources, "-use") {
- @Override
- public boolean process(String opt, List<String> args) {
- classuse = true;
- return true;
- }
- },
- new Option(resources, "-windowtitle", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- windowtitle = args.get(0).replaceAll("\\<.*?>", "");
- return true;
- }
- },
- new XOption(resources, "-Xdoclint") {
- @Override
- public boolean process(String opt, List<String> args) {
- doclintOpts.put(this, DocLint.XMSGS_OPTION);
- return true;
- }
- },
- new XOption(resources, "-Xdocrootparent", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- docrootparent = args.get(0);
- try {
- URL ignored = new URL(docrootparent);
- } catch (MalformedURLException e) {
- reporter.print(ERROR, getText("doclet.MalformedURL", docrootparent));
- return false;
- }
- return true;
- }
- },
- new XOption(resources, "doclet.usage.xdoclint-extended", "-Xdoclint:", 0) {
- @Override
- public boolean process(String opt, List<String> args) {
- String dopt = opt.replace("-Xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX);
- doclintOpts.put(this, dopt);
- if (dopt.contains("/")) {
- reporter.print(ERROR, getText("doclet.Option_doclint_no_qualifiers"));
- return false;
- }
- if (!DocLint.isValidOption(dopt)) {
- reporter.print(ERROR, getText("doclet.Option_doclint_invalid_arg"));
- return false;
- }
- return true;
- }
- },
- new XOption(resources, "doclet.usage.xdoclint-package", "-Xdoclint/package:", 0) {
- @Override
- public boolean process(String opt, List<String> args) {
- String dopt = opt.replace("-Xdoclint/package:", DocLint.XCHECK_PACKAGE);
- doclintOpts.put(this, dopt);
- if (!DocLint.isValidOption(dopt)) {
- reporter.print(ERROR, getText("doclet.Option_doclint_package_invalid_arg"));
- return false;
- }
- return true;
- }
- }
- };
- Set<Doclet.Option> oset = new TreeSet<>();
- oset.addAll(Arrays.asList(options));
- oset.addAll(super.getSupportedOptions());
- return oset;
- }
-}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
/**
* The configuration used in this run of the standard doclet.
*/
- ConfigurationImpl configuration;
+ HtmlConfiguration configuration;
/**
* The current class being documented.
@@ -87,7 +87,7 @@
* @param configuration the configuration used in this run
* of the standard doclet.
*/
- public ConstantsSummaryWriterImpl(ConfigurationImpl configuration) {
+ public ConstantsSummaryWriterImpl(HtmlConfiguration configuration) {
super(configuration, DocPaths.CONSTANT_VALUES);
this.configuration = configuration;
constantsTableSummary = configuration.getText("doclet.Constants_Table_Summary",
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java Mon Jun 05 13:45:34 2017 -0700
@@ -162,7 +162,7 @@
* @param configuration the configuration in which to find the
* resources used to look up resource keys, and other details.
*/
- Contents(ConfigurationImpl configuration) {
+ Contents(HtmlConfiguration configuration) {
this.resources = configuration.getResources();
allClassesLabel = getNonBreakContent("doclet.All_Classes");
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@
private EnumMap<DeprElementKind, AbstractMemberWriter> writerMap;
- private ConfigurationImpl configuration;
+ private HtmlConfiguration configuration;
/**
* Constructor.
@@ -213,7 +213,7 @@
* @param filename the file to be generated
*/
- public DeprecatedListWriter(ConfigurationImpl configuration, DocPath filename) {
+ public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
this.configuration = configuration;
NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
@@ -260,7 +260,7 @@
* @param configuration the current configuration of the doclet.
* @throws DocFileIOException if there is a problem writing the deprecated list
*/
- public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.DEPRECATED_LIST;
DeprecatedListWriter depr = new DeprecatedListWriter(configuration, filename);
depr.generateDeprecatedListFile(
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FrameOutputWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -67,7 +67,7 @@
* @param configuration for this run
* @param filename File to be generated.
*/
- public FrameOutputWriter(ConfigurationImpl configuration, DocPath filename) {
+ public FrameOutputWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
noOfPackages = configuration.packages.size();
}
@@ -80,7 +80,7 @@
* @param configuration the configuration for this doclet
* @throws DocFileIOException if there is a problem generating the frame file
*/
- public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
FrameOutputWriter framegen = new FrameOutputWriter(configuration, DocPaths.INDEX);
framegen.generateFrameFile();
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@
* Constructor to construct HelpWriter object.
* @param filename File to be generated.
*/
- public HelpWriter(ConfigurationImpl configuration,
+ public HelpWriter(HtmlConfiguration configuration,
DocPath filename) {
super(configuration, filename);
}
@@ -68,7 +68,7 @@
*
* @throws DocFileIOException if there is a problem while generating the documentation
*/
- public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.HELP_DOC;
HelpWriter helpgen = new HelpWriter(configuration, filename);
helpgen.generateHelpFile();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Mon Jun 05 13:45:34 2017 -0700
@@ -0,0 +1,790 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.javadoc.internal.doclets.formats.html;
+
+import java.net.*;
+import java.util.*;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.TypeElement;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+
+import com.sun.source.util.DocTreePath;
+import com.sun.tools.doclint.DocLint;
+
+import jdk.javadoc.doclet.Doclet;
+import jdk.javadoc.doclet.DocletEnvironment;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlVersion;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
+import jdk.javadoc.internal.doclets.toolkit.Content;
+import jdk.javadoc.internal.doclets.toolkit.Messages;
+import jdk.javadoc.internal.doclets.toolkit.Resources;
+import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
+import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
+import jdk.javadoc.internal.doclets.toolkit.util.Utils;
+
+import static javax.tools.Diagnostic.Kind.*;
+
+/**
+ * Configure the output based on the command line options.
+ * <p>
+ * Also determine the length of the command line option. For example,
+ * for a option "-header" there will be a string argument associated, then the
+ * the length of option "-header" is two. But for option "-nohelp" no argument
+ * is needed so it's length is 1.
+ * </p>
+ * <p>
+ * Also do the error checking on the options used. For example it is illegal to
+ * use "-helpfile" option when already "-nohelp" option is used.
+ * </p>
+ *
+ * <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
+ * deletion without notice.</b>
+ *
+ * @author Robert Field.
+ * @author Atul Dambalkar.
+ * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
+ */
+public class HtmlConfiguration extends BaseConfiguration {
+
+ /**
+ * The build date. Note: For now, we will use
+ * a version number instead of a date.
+ */
+ public static final String BUILD_DATE = System.getProperty("java.version");
+
+ /**
+ * Argument for command line option "-header".
+ */
+ public String header = "";
+
+ /**
+ * Argument for command line option "-packagesheader".
+ */
+ public String packagesheader = "";
+
+ /**
+ * Argument for command line option "-footer".
+ */
+ public String footer = "";
+
+ /**
+ * Argument for command line option "-doctitle".
+ */
+ public String doctitle = "";
+
+ /**
+ * Argument for command line option "-windowtitle".
+ */
+ public String windowtitle = "";
+
+ /**
+ * Argument for command line option "-top".
+ */
+ public String top = "";
+
+ /**
+ * Argument for command line option "-bottom".
+ */
+ public String bottom = "";
+
+ /**
+ * Argument for command line option "-helpfile".
+ */
+ public String helpfile = "";
+
+ /**
+ * Argument for command line option "-stylesheetfile".
+ */
+ public String stylesheetfile = "";
+
+ /**
+ * Argument for command line option "-Xdocrootparent".
+ */
+ public String docrootparent = "";
+
+ /**
+ * True if command line option "-nohelp" is used. Default value is false.
+ */
+ public boolean nohelp = false;
+
+ /**
+ * True if command line option "-splitindex" is used. Default value is
+ * false.
+ */
+ public boolean splitindex = false;
+
+ /**
+ * False if command line option "-noindex" is used. Default value is true.
+ */
+ public boolean createindex = true;
+
+ /**
+ * True if command line option "-use" is used. Default value is false.
+ */
+ public boolean classuse = false;
+
+ /**
+ * False if command line option "-notree" is used. Default value is true.
+ */
+ public boolean createtree = true;
+
+ /**
+ * True if command line option "-nodeprecated" is used. Default value is
+ * false.
+ */
+ public boolean nodeprecatedlist = false;
+
+ /**
+ * True if command line option "-nonavbar" is used. Default value is false.
+ */
+ public boolean nonavbar = false;
+
+ /**
+ * True if command line option "-nooverview" is used. Default value is
+ * false
+ */
+ private boolean nooverview = false;
+
+ /**
+ * The overview path specified with "-overview" flag.
+ */
+ public String overviewpath = null;
+
+ /**
+ * 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;
+
+ /**
+ * Specifies whether or not frames should be generated.
+ * Defaults to true; can be set by --frames; can be set to false by --no-frames; last one wins.
+ */
+ public boolean frames = true;
+
+ /**
+ * This is the HTML version of the generated pages. HTML 4.01 is the default output version.
+ */
+ public HtmlVersion htmlVersion = HtmlVersion.HTML4;
+
+ /**
+ * Collected set of doclint options
+ */
+ public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
+
+ public final Resources resources;
+
+ /**
+ * First file to appear in the right-hand frame in the generated
+ * documentation.
+ */
+ public DocPath topFile = DocPath.empty;
+
+ /**
+ * The TypeElement for the class file getting generated.
+ */
+ public TypeElement currentTypeElement = null; // Set this TypeElement in the ClassWriter.
+
+ protected List<SearchIndexItem> memberSearchIndex = new ArrayList<>();
+
+ protected List<SearchIndexItem> moduleSearchIndex = new ArrayList<>();
+
+ protected List<SearchIndexItem> packageSearchIndex = new ArrayList<>();
+
+ protected List<SearchIndexItem> tagSearchIndex = new ArrayList<>();
+
+ protected List<SearchIndexItem> typeSearchIndex = new ArrayList<>();
+
+ protected Map<Character,List<SearchIndexItem>> tagSearchIndexMap = new HashMap<>();
+
+ protected Set<Character> tagSearchIndexKeys;
+
+ protected Contents contents;
+
+ protected Messages messages;
+
+ /**
+ * Constructor. Initializes resource for the
+ * {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}.
+ */
+ public HtmlConfiguration(Doclet doclet) {
+ super(doclet);
+ resources = new Resources(this,
+ BaseConfiguration.sharedResourceBundleName,
+ "jdk.javadoc.internal.doclets.formats.html.resources.standard");
+
+ messages = new Messages(this);
+ contents = new Contents(this);
+ }
+
+ private final String versionRBName = "jdk.javadoc.internal.tool.resources.version";
+ private ResourceBundle versionRB;
+
+ /**
+ * Return the build date for the doclet.
+ * @return the build date
+ */
+ @Override
+ public String getDocletSpecificBuildDate() {
+ if (versionRB == null) {
+ try {
+ versionRB = ResourceBundle.getBundle(versionRBName, getLocale());
+ } catch (MissingResourceException e) {
+ return BUILD_DATE;
+ }
+ }
+
+ try {
+ return versionRB.getString("release");
+ } catch (MissingResourceException e) {
+ return BUILD_DATE;
+ }
+ }
+
+ @Override
+ public Resources getResources() {
+ return resources;
+ }
+
+ @Override
+ public Messages getMessages() {
+ return messages;
+ }
+
+ protected boolean validateOptions() {
+ // check shared options
+ if (!generalValidOptions()) {
+ return false;
+ }
+ // check if helpfile exists
+ if (!helpfile.isEmpty()) {
+ DocFile help = DocFile.createFileForInput(this, helpfile);
+ if (!help.exists()) {
+ reporter.print(ERROR, getText("doclet.File_not_found", helpfile));
+ return false;
+ }
+ }
+
+ // In a more object-oriented world, this would be done by methods on the Option objects.
+ // Note that -windowtitle silently removes any and all HTML elements, and so does not need
+ // to be handled here.
+ utils.checkJavaScriptInOption("-header", header);
+ utils.checkJavaScriptInOption("-footer", footer);
+ utils.checkJavaScriptInOption("-top", top);
+ utils.checkJavaScriptInOption("-bottom", bottom);
+ utils.checkJavaScriptInOption("-doctitle", doctitle);
+ utils.checkJavaScriptInOption("-packagesheader", packagesheader);
+
+ return true;
+ }
+
+
+ @Override
+ public boolean finishOptionSettings() {
+ if (!validateOptions()) {
+ return false;
+ }
+ if (!getSpecifiedTypeElements().isEmpty()) {
+ Map<String, PackageElement> map = new HashMap<>();
+ PackageElement pkg;
+ for (TypeElement aClass : getIncludedTypeElements()) {
+ pkg = utils.containingPackage(aClass);
+ if (!map.containsKey(utils.getPackageName(pkg))) {
+ map.put(utils.getPackageName(pkg), pkg);
+ }
+ }
+ }
+ setCreateOverview();
+ setTopFile(docEnv);
+ workArounds.initDocLint(doclintOpts.values(), tagletManager.getCustomTagNames(),
+ Utils.toLowerCase(htmlVersion.name()));
+ return true;
+ }
+
+ /**
+ * Return true if the generated output is HTML5.
+ */
+ public boolean isOutputHtml5() {
+ return htmlVersion == HtmlVersion.HTML5;
+ }
+
+ /**
+ * Return true if the tag is allowed for this specific version of HTML.
+ */
+ public boolean allowTag(HtmlTag htmlTag) {
+ return htmlTag.allowTag(this.htmlVersion);
+ }
+
+ /**
+ * Decide the page which will appear first in the right-hand frame. It will
+ * be "overview-summary.html" if "-overview" option is used or no
+ * "-overview" but the number of packages is more than one. It will be
+ * "package-summary.html" of the respective package if there is only one
+ * package to document. It will be a class page(first in the sorted order),
+ * if only classes are provided on the command line.
+ *
+ * @param docEnv the doclet environment
+ */
+ protected void setTopFile(DocletEnvironment docEnv) {
+ if (!checkForDeprecation(docEnv)) {
+ return;
+ }
+ if (createoverview) {
+ topFile = DocPaths.overviewSummary(frames);
+ } else {
+ if (showModules) {
+ topFile = DocPath.empty.resolve(DocPaths.moduleSummary(modules.first()));
+ } else if (packages.size() == 1 && packages.first().isUnnamed()) {
+ List<TypeElement> classes = new ArrayList<>(getIncludedTypeElements());
+ if (!classes.isEmpty()) {
+ TypeElement te = getValidClass(classes);
+ topFile = DocPath.forClass(utils, te);
+ }
+ } else if (!packages.isEmpty()) {
+ topFile = DocPath.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY);
+ }
+ }
+ }
+
+ protected TypeElement getValidClass(List<TypeElement> classes) {
+ if (!nodeprecated) {
+ return classes.get(0);
+ }
+ for (TypeElement te : classes) {
+ if (!utils.isDeprecated(te)) {
+ return te;
+ }
+ }
+ return null;
+ }
+
+ protected boolean checkForDeprecation(DocletEnvironment docEnv) {
+ for (TypeElement te : getIncludedTypeElements()) {
+ if (isGeneratedDoc(te)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Generate "overview.html" page if option "-overview" is used or number of
+ * packages is more than one. Sets {@link #createoverview} field to true.
+ */
+ protected void setCreateOverview() {
+ if ((overviewpath != null || packages.size() > 1) && !nooverview) {
+ createoverview = true;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public WriterFactory getWriterFactory() {
+ return new WriterFactoryImpl(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Locale getLocale() {
+ if (locale == null)
+ return Locale.getDefault();
+ return locale;
+ }
+
+ /**
+ * Return the path of the overview file or null if it does not exist.
+ *
+ * @return the path of the overview file or null if it does not exist.
+ */
+ @Override
+ public JavaFileObject getOverviewPath() {
+ if (overviewpath != null && getFileManager() instanceof StandardJavaFileManager) {
+ StandardJavaFileManager fm = (StandardJavaFileManager) getFileManager();
+ return fm.getJavaFileObjects(overviewpath).iterator().next();
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JavaFileManager getFileManager() {
+ return docEnv.getJavaFileManager();
+ }
+
+ @Override
+ public boolean showMessage(DocTreePath path, String key) {
+ return (path == null || workArounds.haveDocLint());
+ }
+
+ @Override
+ public boolean showMessage(Element e, String key) {
+ return (e == null || workArounds.haveDocLint());
+ }
+
+ @Override
+ public String getText(String key) {
+ return resources.getText(key);
+ }
+
+ @Override
+ public String getText(String key, String... args) {
+ return resources.getText(key, (Object[]) args);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ @Override
+ public Content getContent(String key) {
+ return contents.getContent(key);
+ }
+
+ /**
+ * Get the configuration string as a content.
+ *
+ * @param key the key to look for in the configuration file
+ * @param o string or content argument added to configuration text
+ * @return a content tree for the text
+ */
+ @Override
+ public Content getContent(String key, Object o) {
+ return contents.getContent(key, o);
+ }
+
+ /**
+ * Get the configuration string as a content.
+ *
+ * @param key the key to look for in the configuration file
+ * @param o1 resource argument
+ * @param o2 resource argument
+ * @return a content tree for the text
+ */
+ @Override
+ public Content getContent(String key, Object o1, Object o2) {
+ return contents.getContent(key, o1, o2);
+ }
+
+ /**
+ * Get the configuration string as a content.
+ *
+ * @param key the key to look for in the configuration file
+ * @param o0 string or content argument added to configuration text
+ * @param o1 string or content argument added to configuration text
+ * @param o2 string or content argument added to configuration text
+ * @return a content tree for the text
+ */
+ @Override
+ public Content getContent(String key, Object o0, Object o1, Object o2) {
+ return contents.getContent(key, o0, o1, o2);
+ }
+
+ protected void buildSearchTagIndex() {
+ for (SearchIndexItem sii : tagSearchIndex) {
+ String tagLabel = sii.getLabel();
+ Character unicode = (tagLabel.length() == 0)
+ ? '*'
+ : Character.toUpperCase(tagLabel.charAt(0));
+ List<SearchIndexItem> list = tagSearchIndexMap.get(unicode);
+ if (list == null) {
+ list = new ArrayList<>();
+ tagSearchIndexMap.put(unicode, list);
+ }
+ list.add(sii);
+ }
+ tagSearchIndexKeys = tagSearchIndexMap.keySet();
+ }
+
+ @Override
+ public Set<Doclet.Option> getSupportedOptions() {
+ Resources resources = getResources();
+ Doclet.Option[] options = {
+ new Option(resources, "-bottom", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ bottom = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-charset", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ charset = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-doctitle", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ doctitle = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-footer", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ footer = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-header", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ header = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-helpfile", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ if (nohelp == true) {
+ reporter.print(ERROR, getText("doclet.Option_conflict",
+ "-helpfile", "-nohelp"));
+ return false;
+ }
+ if (!helpfile.isEmpty()) {
+ reporter.print(ERROR, getText("doclet.Option_reuse",
+ "-helpfile"));
+ return false;
+ }
+ helpfile = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-html4") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ htmlVersion = HtmlVersion.HTML4;
+ return true;
+ }
+ },
+ new Option(resources, "-html5") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ htmlVersion = HtmlVersion.HTML5;
+ return true;
+ }
+ },
+ new Option(resources, "-nohelp") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ nohelp = true;
+ if (!helpfile.isEmpty()) {
+ reporter.print(ERROR, getText("doclet.Option_conflict",
+ "-nohelp", "-helpfile"));
+ return false;
+ }
+ return true;
+ }
+ },
+ new Option(resources, "-nodeprecatedlist") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ nodeprecatedlist = true;
+ return true;
+ }
+ },
+ new Option(resources, "-noindex") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ createindex = false;
+ if (splitindex == true) {
+ reporter.print(ERROR, getText("doclet.Option_conflict",
+ "-noindex", "-splitindex"));
+ return false;
+ }
+ return true;
+ }
+ },
+ new Option(resources, "-nonavbar") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ nonavbar = true;
+ return true;
+ }
+ },
+ new Hidden(resources, "-nooverview") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ nooverview = true;
+ if (overviewpath != null) {
+ reporter.print(ERROR, getText("doclet.Option_conflict",
+ "-nooverview", "-overview"));
+ return false;
+ }
+ return true;
+ }
+ },
+ new Option(resources, "-notree") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ createtree = false;
+ return true;
+ }
+ },
+ new Option(resources, "-overview", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ overviewpath = args.get(0);
+ if (nooverview == true) {
+ reporter.print(ERROR, getText("doclet.Option_conflict",
+ "-overview", "-nooverview"));
+ return false;
+ }
+ return true;
+ }
+ },
+ new Option(resources, "--frames") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ frames = true;
+ return true;
+ }
+ },
+ new Option(resources, "--no-frames") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ frames = false;
+ return true;
+ }
+ },
+ new Hidden(resources, "-packagesheader", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ packagesheader = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-splitindex") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ splitindex = true;
+ if (createindex == false) {
+ reporter.print(ERROR, getText("doclet.Option_conflict",
+ "-splitindex", "-noindex"));
+ return false;
+ }
+ return true;
+ }
+ },
+ new Option(resources, "-stylesheetfile", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ stylesheetfile = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-top", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ top = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-use") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ classuse = true;
+ return true;
+ }
+ },
+ new Option(resources, "-windowtitle", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ windowtitle = args.get(0).replaceAll("\\<.*?>", "");
+ return true;
+ }
+ },
+ new XOption(resources, "-Xdoclint") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ doclintOpts.put(this, DocLint.XMSGS_OPTION);
+ return true;
+ }
+ },
+ new XOption(resources, "-Xdocrootparent", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ docrootparent = args.get(0);
+ try {
+ URL ignored = new URL(docrootparent);
+ } catch (MalformedURLException e) {
+ reporter.print(ERROR, getText("doclet.MalformedURL", docrootparent));
+ return false;
+ }
+ return true;
+ }
+ },
+ new XOption(resources, "doclet.usage.xdoclint-extended", "-Xdoclint:", 0) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ String dopt = opt.replace("-Xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX);
+ doclintOpts.put(this, dopt);
+ if (dopt.contains("/")) {
+ reporter.print(ERROR, getText("doclet.Option_doclint_no_qualifiers"));
+ return false;
+ }
+ if (!DocLint.isValidOption(dopt)) {
+ reporter.print(ERROR, getText("doclet.Option_doclint_invalid_arg"));
+ return false;
+ }
+ return true;
+ }
+ },
+ new XOption(resources, "doclet.usage.xdoclint-package", "-Xdoclint/package:", 0) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ String dopt = opt.replace("-Xdoclint/package:", DocLint.XCHECK_PACKAGE);
+ doclintOpts.put(this, dopt);
+ if (!DocLint.isValidOption(dopt)) {
+ reporter.print(ERROR, getText("doclet.Option_doclint_package_invalid_arg"));
+ return false;
+ }
+ return true;
+ }
+ }
+ };
+ Set<Doclet.Option> oset = new TreeSet<>();
+ oset.addAll(Arrays.asList(options));
+ oset.addAll(super.getSupportedOptions());
+ return oset;
+ }
+}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Mon Jun 05 13:45:34 2017 -0700
@@ -31,7 +31,6 @@
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.doclet.Doclet.Option;
import jdk.javadoc.doclet.DocletEnvironment;
import jdk.javadoc.doclet.Reporter;
import jdk.javadoc.internal.doclets.toolkit.AbstractDoclet;
@@ -61,7 +60,7 @@
public class HtmlDoclet extends AbstractDoclet {
public HtmlDoclet() {
- configuration = new ConfigurationImpl(this);
+ configuration = new HtmlConfiguration(this);
}
@Override // defined by Doclet
@@ -72,7 +71,7 @@
/**
* The global configuration information for this run.
*/
- private final ConfigurationImpl configuration;
+ private final HtmlConfiguration configuration;
private Messages messages;
@@ -95,7 +94,7 @@
* @return the configuration
*/
@Override // defined by AbstractDoclet
- public ConfigurationImpl getConfiguration() {
+ public HtmlConfiguration getConfiguration() {
return configuration;
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
@@ -94,9 +94,7 @@
import jdk.javadoc.internal.doclets.toolkit.util.ImplementedMethods;
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
-import static com.sun.source.doctree.AttributeTree.ValueKind.*;
import static com.sun.source.doctree.DocTree.Kind.*;
-import static jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocWriter.CONTENT_TYPE;
import static jdk.javadoc.internal.doclets.toolkit.util.CommentHelper.SPACER;
@@ -141,7 +139,7 @@
/**
* The global configuration information for this run.
*/
- public final ConfigurationImpl configuration;
+ public final HtmlConfiguration configuration;
protected final Utils utils;
@@ -180,7 +178,7 @@
*
* @param path File to be generated.
*/
- public HtmlDocletWriter(ConfigurationImpl configuration, DocPath path) {
+ public HtmlDocletWriter(HtmlConfiguration configuration, DocPath path) {
super(configuration, path);
this.configuration = configuration;
this.contents = configuration.contents;
@@ -2601,7 +2599,7 @@
* @return the configuration for this doclet.
*/
@Override
- public Configuration configuration() {
+ public BaseConfiguration configuration() {
return configuration;
}
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,6 @@
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
-import static jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocWriter.CONTENT_TYPE;
-
/**
* Writes an index.html file that tries to redirect to an alternate page.
* The redirect uses JavaSCript, if enabled, falling back on
@@ -50,7 +48,7 @@
*/
public class IndexRedirectWriter extends HtmlDocletWriter {
- public static void generate(ConfigurationImpl configuration)
+ public static void generate(HtmlConfiguration configuration)
throws DocFileIOException {
IndexRedirectWriter indexRedirect;
DocPath filename = DocPaths.INDEX;
@@ -58,7 +56,7 @@
indexRedirect.generateIndexFile();
}
- IndexRedirectWriter(ConfigurationImpl configuration, DocPath filename) {
+ IndexRedirectWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,15 +33,13 @@
import javax.lang.model.type.TypeMirror;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
import jdk.javadoc.internal.doclets.toolkit.util.links.LinkFactory;
import jdk.javadoc.internal.doclets.toolkit.util.links.LinkInfo;
-import static jdk.javadoc.internal.doclets.formats.html.LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS;
-
/**
* A factory that returns a link given the information about it.
*
@@ -73,7 +71,7 @@
*/
@Override
protected Content getClassLink(LinkInfo linkInfo) {
- Configuration configuration = m_writer.configuration;
+ BaseConfiguration configuration = m_writer.configuration;
Utils utils = configuration.utils;
LinkInfoImpl classLinkInfo = (LinkInfoImpl) linkInfo;
boolean noLabel = linkInfo.label == null || linkInfo.label.isEmpty();
@@ -198,7 +196,7 @@
* @return the tool tip for the appropriate class.
*/
private String getClassToolTip(TypeElement typeElement, boolean isTypeLink) {
- Configuration configuration = m_writer.configuration;
+ BaseConfiguration configuration = m_writer.configuration;
Utils utils = configuration.utils;
if (isTypeLink) {
return configuration.getText("doclet.Href_Type_Param_Title",
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkInfoImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkInfoImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -218,7 +218,7 @@
RECEIVER_TYPE
}
- public final ConfigurationImpl configuration;
+ public final HtmlConfiguration configuration;
/**
* The location of the link.
@@ -247,7 +247,7 @@
* @param context the context of the link.
* @param ee the member to link to.
*/
- public LinkInfoImpl(ConfigurationImpl configuration, Kind context, ExecutableElement ee) {
+ public LinkInfoImpl(HtmlConfiguration configuration, Kind context, ExecutableElement ee) {
this.configuration = configuration;
this.utils = configuration.utils;
this.executableElement = ee;
@@ -269,7 +269,7 @@
* @param context the context of the link.
* @param typeElement the class to link to.
*/
- public LinkInfoImpl(ConfigurationImpl configuration, Kind context, TypeElement typeElement) {
+ public LinkInfoImpl(HtmlConfiguration configuration, Kind context, TypeElement typeElement) {
this.configuration = configuration;
this.utils = configuration.utils;
this.typeElement = typeElement;
@@ -283,7 +283,7 @@
* @param context the context of the link.
* @param type the class to link to.
*/
- public LinkInfoImpl(ConfigurationImpl configuration, Kind context, TypeMirror type) {
+ public LinkInfoImpl(HtmlConfiguration configuration, Kind context, TypeMirror type) {
this.configuration = configuration;
this.utils = configuration.utils;
this.type = type;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.ElementFilter;
-import jdk.javadoc.doclet.DocletEnvironment;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@@ -75,7 +74,7 @@
* @param configuration the configuration of the doclet.
* @param moduleElement moduleElement under consideration.
*/
- public ModuleFrameWriter(ConfigurationImpl configuration, ModuleElement moduleElement) {
+ public ModuleFrameWriter(HtmlConfiguration configuration, ModuleElement moduleElement) {
super(configuration, DocPaths.moduleTypeFrame(moduleElement));
this.mdle = moduleElement;
if (configuration.getSpecifiedPackageElements().isEmpty()) {
@@ -91,7 +90,7 @@
* @param moduleElement The package for which "module_name-type-frame.html" is to be generated.
* @throws DocFileIOException if there is a problem generating the module summary file
*/
- public static void generate(ConfigurationImpl configuration, ModuleElement moduleElement)
+ public static void generate(HtmlConfiguration configuration, ModuleElement moduleElement)
throws DocFileIOException {
ModuleFrameWriter mdlgen = new ModuleFrameWriter(configuration, moduleElement);
String mdlName = moduleElement.getQualifiedName().toString();
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -63,7 +63,7 @@
* @param configuration the configuration object
* @param filename Name of the module index file to be generated.
*/
- public ModuleIndexFrameWriter(ConfigurationImpl configuration,
+ public ModuleIndexFrameWriter(HtmlConfiguration configuration,
DocPath filename) {
super(configuration, filename);
}
@@ -73,7 +73,7 @@
* @throws DocFileIOException
* @param configuration the configuration object
*/
- public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.MODULE_OVERVIEW_FRAME;
ModuleIndexFrameWriter modulegen = new ModuleIndexFrameWriter(configuration, filename);
modulegen.buildModuleIndexFile("doclet.Window_Overview", false);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -77,7 +77,7 @@
* @param configuration the configuration object
* @param filename the name of the generated file
*/
- public ModuleIndexWriter(ConfigurationImpl configuration, DocPath filename) {
+ public ModuleIndexWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
groupModuleMap = configuration.group.groupModules(configuration.modules);
groupList = configuration.group.getGroupList();
@@ -89,7 +89,7 @@
* @param configuration the current configuration of the doclet.
* @throws DocFileIOException if there is a problem generating the module index page
*/
- public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.overviewSummary(configuration.frames);
ModuleIndexWriter mdlgen = new ModuleIndexWriter(configuration, filename);
mdlgen.buildModuleIndexFile("doclet.Window_Overview_Summary", true);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModulePackageIndexFrameWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -65,7 +65,7 @@
* @param configuration the configuration object
* @param filename Name of the package index file to be generated.
*/
- public ModulePackageIndexFrameWriter(ConfigurationImpl configuration, DocPath filename) {
+ public ModulePackageIndexFrameWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
}
@@ -75,7 +75,7 @@
* @param configuration the configuration object
* @param mdle the module being documented
*/
- public static void generate(ConfigurationImpl configuration, ModuleElement mdle) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration, ModuleElement mdle) throws DocFileIOException {
DocPath filename = DocPaths.moduleFrame(mdle);
ModulePackageIndexFrameWriter modpackgen = new ModulePackageIndexFrameWriter(configuration, filename);
modpackgen.buildModulePackagesIndexFile("doclet.Window_Overview", false, mdle);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -181,7 +181,7 @@
* @param prevModule Previous module in the sorted array.
* @param nextModule Next module in the sorted array.
*/
- public ModuleWriterImpl(ConfigurationImpl configuration,
+ public ModuleWriterImpl(HtmlConfiguration configuration,
ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule) {
super(configuration, DocPaths.moduleSummary(mdle));
this.prevModule = prevModule;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageFrameWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,13 +30,12 @@
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.doclet.DocletEnvironment;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
@@ -79,7 +78,7 @@
* @param configuration the configuration of the doclet.
* @param packageElement PackageElement under consideration.
*/
- public PackageFrameWriter(ConfigurationImpl configuration, PackageElement packageElement) {
+ public PackageFrameWriter(HtmlConfiguration configuration, PackageElement packageElement) {
super(configuration, DocPath.forPackage(packageElement).resolve(DocPaths.PACKAGE_FRAME));
this.packageElement = packageElement;
if (configuration.getSpecifiedPackageElements().isEmpty()) {
@@ -96,7 +95,7 @@
* @param packageElement The package for which "pacakge-frame.html" is to be generated.
* @throws DocFileIOException if there is a problem generating the package summary page
*/
- public static void generate(ConfigurationImpl configuration, PackageElement packageElement)
+ public static void generate(HtmlConfiguration configuration, PackageElement packageElement)
throws DocFileIOException {
PackageFrameWriter packgen = new PackageFrameWriter(configuration, packageElement);
String pkgName = configuration.utils.getPackageName(packageElement);
@@ -127,7 +126,7 @@
* @param contentTree the content tree to which the listing will be added
*/
protected void addClassListing(HtmlTree contentTree) {
- Configuration config = configuration;
+ BaseConfiguration config = configuration;
if (utils.isSpecified(packageElement)) {
addClassKindListing(utils.getInterfaces(packageElement),
contents.interfaces, contentTree);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
*
* @param filename Name of the package index file to be generated.
*/
- public PackageIndexFrameWriter(ConfigurationImpl configuration, DocPath filename) {
+ public PackageIndexFrameWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
}
@@ -68,7 +68,7 @@
* Generate the package index file named "overview-frame.html".
* @throws DocFileIOException
*/
- public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.OVERVIEW_FRAME;
PackageIndexFrameWriter packgen = new PackageIndexFrameWriter(configuration, filename);
packgen.buildPackageIndexFile("doclet.Window_Overview", false);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -83,7 +83,7 @@
* @param filename the path of the page to be generated
* @see Group
*/
- public PackageIndexWriter(ConfigurationImpl configuration, DocPath filename) {
+ public PackageIndexWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
groupPackageMap = configuration.group.groupPackages(packages);
groupList = configuration.group.getGroupList();
@@ -95,7 +95,7 @@
* @param configuration the current configuration of the doclet.
* @throws DocFileIOException if there is a problem generating the package index page
*/
- public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
+ public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
DocPath filename = DocPaths.overviewSummary(configuration.frames);
PackageIndexWriter packgen = new PackageIndexWriter(configuration, filename);
packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@
* @param prev the previous package
* @param next the next package
*/
- public PackageTreeWriter(ConfigurationImpl configuration,
+ public PackageTreeWriter(HtmlConfiguration configuration,
DocPath path,
PackageElement packageElement,
PackageElement prev, PackageElement next) {
@@ -98,7 +98,7 @@
* deprecated classe or interfaces.
* @throws DocFileIOException if there is a problem generating the package tree page
*/
- public static void generate(ConfigurationImpl configuration,
+ public static void generate(HtmlConfiguration configuration,
PackageElement pkg, PackageElement prev,
PackageElement next, boolean noDeprecated)
throws DocFileIOException {
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@
*
* @param filename the file to be generated.
*/
- public PackageUseWriter(ConfigurationImpl configuration,
+ public PackageUseWriter(HtmlConfiguration configuration,
ClassUseMapper mapper, DocPath filename,
PackageElement pkgElement) {
super(configuration, DocPath.forPackage(pkgElement).resolve(filename));
@@ -99,7 +99,7 @@
* @param pkgElement the package being documented.
* @throws DocFileIOException if there is a problem generating the package use page
*/
- public static void generate(ConfigurationImpl configuration,
+ public static void generate(HtmlConfiguration configuration,
ClassUseMapper mapper, PackageElement pkgElement)
throws DocFileIOException {
DocPath filename = DocPaths.PACKAGE_USE;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -99,7 +99,7 @@
* @param prev Previous package in the sorted array.
* @param next Next package in the sorted array.
*/
- public PackageWriterImpl(ConfigurationImpl configuration,
+ public PackageWriterImpl(HtmlConfiguration configuration,
PackageElement packageElement, PackageElement prev, PackageElement next) {
super(configuration, DocPath
.forPackage(packageElement)
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,6 @@
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.SerializedFormWriter;
-import jdk.javadoc.internal.doclets.toolkit.SerializedFormWriter.SerialFieldWriter;
-import jdk.javadoc.internal.doclets.toolkit.SerializedFormWriter.SerialMethodWriter;
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
@@ -64,7 +62,7 @@
/**
* @param configuration the configuration data for the doclet
*/
- public SerializedFormWriterImpl(ConfigurationImpl configuration) {
+ public SerializedFormWriterImpl(HtmlConfiguration configuration) {
super(configuration, DocPaths.SERIALIZED_FORM);
visibleClasses = configuration.getIncludedTypeElements();
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@
* @param filename Name of the index file to be generated.
* @param indexbuilder Unicode based Index from {@link IndexBuilder}
*/
- public SingleIndexWriter(ConfigurationImpl configuration,
+ public SingleIndexWriter(HtmlConfiguration configuration,
DocPath filename,
IndexBuilder indexbuilder) {
super(configuration, filename, indexbuilder);
@@ -77,7 +77,7 @@
* @param indexbuilder IndexBuilder built by {@link IndexBuilder}
* @throws DocFileIOException if there is a problem generating the index
*/
- public static void generate(ConfigurationImpl configuration,
+ public static void generate(HtmlConfiguration configuration,
IndexBuilder indexbuilder) throws DocFileIOException {
DocPath filename = DocPaths.INDEX_ALL;
SingleIndexWriter indexgen = new SingleIndexWriter(configuration,
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
*/
private static final String NEW_LINE = DocletConstants.NL;
- private final ConfigurationImpl configuration;
+ private final HtmlConfiguration configuration;
private final Messages messages;
private final Utils utils;
@@ -88,8 +88,8 @@
*/
private DocPath relativePath = DocPath.empty;
- private SourceToHTMLConverter(ConfigurationImpl configuration, DocletEnvironment rd,
- DocPath outputdir) {
+ private SourceToHTMLConverter(HtmlConfiguration configuration, DocletEnvironment rd,
+ DocPath outputdir) {
this.configuration = configuration;
this.messages = configuration.getMessages();
this.utils = configuration.utils;
@@ -106,8 +106,8 @@
* @throws DocFileIOException if there is a problem generating an output file
* @throws SimpleDocletException if there is a problem reading a source file
*/
- public static void convertRoot(ConfigurationImpl configuration, DocletEnvironment docEnv,
- DocPath outputdir) throws DocFileIOException, SimpleDocletException {
+ public static void convertRoot(HtmlConfiguration configuration, DocletEnvironment docEnv,
+ DocPath outputdir) throws DocFileIOException, SimpleDocletException {
new SourceToHTMLConverter(configuration, docEnv, outputdir).generate();
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -82,7 +82,7 @@
* @param prev the previous character that was indexed
* @param next the next character to be indexed
*/
- public SplitIndexWriter(ConfigurationImpl configuration,
+ public SplitIndexWriter(HtmlConfiguration configuration,
DocPath path,
IndexBuilder indexbuilder,
Collection<Character> elements,
@@ -101,7 +101,7 @@
* @param indexbuilder IndexBuilder built by {@link IndexBuilder}
* @throws DocFileIOException if there is a problem generating the index files
*/
- public static void generate(ConfigurationImpl configuration,
+ public static void generate(HtmlConfiguration configuration,
IndexBuilder indexbuilder) throws DocFileIOException {
DocPath path = DocPaths.INDEX_FILES;
Set<Character> keys = new TreeSet<>(indexbuilder.getIndexMap().keySet());
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
*/
protected HtmlTree mainTree = HtmlTree.MAIN();
- public SubWriterHolderWriter(ConfigurationImpl configuration, DocPath filename) {
+ public SubWriterHolderWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename);
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.builders.SerializedFormBuilder;
import jdk.javadoc.internal.doclets.toolkit.taglets.TagletWriter;
@@ -68,7 +68,7 @@
public class TagletWriterImpl extends TagletWriter {
private final HtmlDocletWriter htmlWriter;
- private final ConfigurationImpl configuration;
+ private final HtmlConfiguration configuration;
private final Utils utils;
public TagletWriterImpl(HtmlDocletWriter htmlWriter, boolean isFirstSentence) {
@@ -438,7 +438,7 @@
/**
* {@inheritDoc}
*/
- public Configuration configuration() {
+ public BaseConfiguration configuration() {
return configuration;
}
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
* @param filename String filename
* @param classtree the tree being built.
*/
- public TreeWriter(ConfigurationImpl configuration, DocPath filename, ClassTree classtree) {
+ public TreeWriter(HtmlConfiguration configuration, DocPath filename, ClassTree classtree) {
super(configuration, filename, classtree);
packages = configuration.packages;
classesOnly = packages.isEmpty();
@@ -88,7 +88,7 @@
* @param classtree the class tree being documented.
* @throws DocFileIOException if there is a problem generating the overview tree page
*/
- public static void generate(ConfigurationImpl configuration,
+ public static void generate(HtmlConfiguration configuration,
ClassTree classtree) throws DocFileIOException {
DocPath filename = DocPaths.OVERVIEW_TREE;
TreeWriter treegen = new TreeWriter(configuration, filename, classtree);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,8 +45,6 @@
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
-import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind.*;
-
/**
* The factory that returns HTML writers.
*
@@ -59,8 +57,8 @@
*/
public class WriterFactoryImpl implements WriterFactory {
- private final ConfigurationImpl configuration;
- public WriterFactoryImpl(ConfigurationImpl configuration) {
+ private final HtmlConfiguration configuration;
+ public WriterFactoryImpl(HtmlConfiguration configuration) {
this.configuration = configuration;
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,9 +31,9 @@
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.formats.html.ConfigurationImpl;
+import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
import jdk.javadoc.internal.doclets.formats.html.SectionName;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
@@ -69,7 +69,7 @@
* @param configuration the configuration for this doclet
* @param filename String file name.
*/
- public HtmlDocWriter(Configuration configuration, DocPath filename) {
+ public HtmlDocWriter(BaseConfiguration configuration, DocPath filename) {
super(configuration, filename);
this.pathToRoot = filename.parent().invert();
Messages messages = configuration.getMessages();
@@ -81,7 +81,7 @@
* Accessor for configuration.
* @return the configuration for this doclet
*/
- public abstract Configuration configuration();
+ public abstract BaseConfiguration configuration();
public Content getHyperLink(DocPath link, String label) {
return getHyperLink(link, new StringContent(label), false, "", "", "");
@@ -318,7 +318,7 @@
* @param body the body content tree to be added to the HTML document
* @throws DocFileIOException if there is an error writing the frames document
*/
- public void printFramesDocument(String title, ConfigurationImpl configuration,
+ public void printFramesDocument(String title, HtmlConfiguration configuration,
HtmlTree body) throws DocFileIOException {
Content htmlDocType = configuration.isOutputHtml5()
? DocType.HTML5
@@ -347,7 +347,7 @@
* @param configuration the configuration for this doclet
* @return an HtmlTree for the lINK tag which provides the stylesheet location
*/
- public HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) {
+ public HtmlTree getStyleSheetProperties(HtmlConfiguration configuration) {
String stylesheetfile = configuration.stylesheetfile;
DocPath stylesheet;
if (stylesheetfile.isEmpty()) {
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -29,7 +29,7 @@
import java.util.*;
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Resources;
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
@@ -62,7 +62,7 @@
/**
* The configuration
*/
- protected Configuration configuration;
+ protected BaseConfiguration configuration;
/**
* Header for table displaying modules and description.
@@ -120,7 +120,7 @@
* @param path The directory path to be created for this file
* or null if none to be created.
*/
- public HtmlWriter(Configuration configuration, DocPath path) {
+ public HtmlWriter(BaseConfiguration configuration, DocPath path) {
docFile = DocFile.createFileForOutput(configuration, path);
this.configuration = configuration;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@
/**
* The global configuration information for this run.
*/
- private Configuration configuration;
+ private BaseConfiguration configuration;
protected Messages messages;
@@ -181,7 +181,7 @@
*
* @return the configuration of the doclet.
*/
- public abstract Configuration getConfiguration();
+ public abstract BaseConfiguration getConfiguration();
/**
* Start the generation of files. Call generate methods in the individual
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java Mon Jun 05 13:45:34 2017 -0700
@@ -0,0 +1,1289 @@
+/*
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.javadoc.internal.doclets.toolkit;
+
+import java.io.*;
+import java.lang.ref.*;
+import java.util.*;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ModuleElement;
+import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.util.SimpleElementVisitor9;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+
+import com.sun.source.util.DocTreePath;
+import com.sun.tools.javac.util.DefinedBy;
+import com.sun.tools.javac.util.DefinedBy.Api;
+import jdk.javadoc.doclet.Doclet;
+import jdk.javadoc.doclet.DocletEnvironment;
+import jdk.javadoc.doclet.Reporter;
+import jdk.javadoc.internal.doclets.toolkit.builders.BuilderFactory;
+import jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager;
+import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
+import jdk.javadoc.internal.doclets.toolkit.util.DocFileFactory;
+import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
+import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
+import jdk.javadoc.internal.doclets.toolkit.util.Extern;
+import jdk.javadoc.internal.doclets.toolkit.util.Group;
+import jdk.javadoc.internal.doclets.toolkit.util.MetaKeywords;
+import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException;
+import jdk.javadoc.internal.doclets.toolkit.util.TypeElementCatalog;
+import jdk.javadoc.internal.doclets.toolkit.util.Utils;
+import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
+import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.GetterSetter;
+import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind;
+
+import static javax.tools.Diagnostic.Kind.*;
+
+/**
+ * Configure the output based on the options. Doclets should sub-class
+ * BaseConfiguration, to configure and add their own options. This class contains
+ * all user options which are supported by the 1.1 doclet and the standard
+ * doclet.
+ *
+ * <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
+ * deletion without notice.</b>
+ *
+ * @author Robert Field.
+ * @author Atul Dambalkar.
+ * @author Jamie Ho
+ */
+public abstract class BaseConfiguration {
+ /**
+ * The doclet that created this configuration.
+ */
+ public final Doclet doclet;
+
+ /**
+ * The factory for builders.
+ */
+ protected BuilderFactory builderFactory;
+
+ /**
+ * The taglet manager.
+ */
+ public TagletManager tagletManager;
+
+ /**
+ * The path to the builder XML input file.
+ */
+ public String builderXMLPath;
+
+ /**
+ * The default path to the builder XML.
+ */
+ public static final String DEFAULT_BUILDER_XML = "resources/doclet.xml";
+
+ /**
+ * The path to Taglets
+ */
+ public String tagletpath = null;
+
+ /**
+ * This is true if option "-serialwarn" is used. Defualt value is false to
+ * suppress excessive warnings about serial tag.
+ */
+ public boolean serialwarn = false;
+
+ /**
+ * The specified amount of space between tab stops.
+ */
+ public int sourcetab;
+
+ public String tabSpaces;
+
+ /**
+ * True if we should generate browsable sources.
+ */
+ public boolean linksource = false;
+
+ /**
+ * True if command line option "-nosince" is used. Default value is
+ * false.
+ */
+ public boolean nosince = false;
+
+ /**
+ * True if we should recursively copy the doc-file subdirectories
+ */
+ public boolean copydocfilesubdirs = false;
+
+ /**
+ * Maintain backward compatibility with previous javadoc version
+ */
+ public boolean backwardCompatibility = true;
+
+ /**
+ * The META charset tag used for cross-platform viewing.
+ */
+ public String charset = "";
+
+ /**
+ * 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 = false;
+
+ /**
+ * The meta tag keywords instance.
+ */
+ public final MetaKeywords metakeywords;
+
+ /**
+ * The set of doc-file subdirectories to exclude
+ */
+ protected Set<String> excludedDocFileDirs;
+
+ /**
+ * The set of qualifiers to exclude
+ */
+ protected Set<String> excludedQualifiers;
+
+ /**
+ * The doclet environment.
+ */
+ public DocletEnvironment docEnv;
+
+ /**
+ * An utility class for commonly used helpers
+ */
+ public Utils utils;
+
+ /**
+ * All the temporary accessors to javac internals.
+ */
+ public WorkArounds workArounds;
+
+ /**
+ * Destination directory name, in which doclet will generate the entire
+ * documentation. Default is current directory.
+ */
+ public String destDirName = "";
+
+ /**
+ * Destination directory name, in which doclet will copy the doc-files to.
+ */
+ public String docFileDestDirName = "";
+
+ /**
+ * Encoding for this document. Default is default encoding for this
+ * platform.
+ */
+ public String docencoding = null;
+
+ /**
+ * True if user wants to suppress descriptions and tags.
+ */
+ public boolean nocomment = false;
+
+ /**
+ * Encoding for this document. Default is default encoding for this
+ * platform.
+ */
+ public String encoding = null;
+
+ /**
+ * 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 = false;
+
+ /**
+ * Generate documentation for JavaFX getters and setters automatically
+ * by copying it from the appropriate property definition.
+ */
+ public boolean javafx = false;
+
+ /**
+ * 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</code> is set to true if -version option is
+ * used.Default is don't show version information.
+ */
+ public boolean showversion = false;
+
+ /**
+ * Allow JavaScript in doc comments.
+ */
+ private boolean allowScriptInComments = false;
+
+ /**
+ * Sourcepath from where to read the source files. Default is classpath.
+ *
+ */
+ public String sourcepath = "";
+
+ /**
+ * Generate modules documentation if more than one module is present.
+ */
+ public boolean showModules = false;
+
+ /**
+ * Don't generate deprecated API information at all, if -nodeprecated
+ * option is used. <code>nodepracted</code> is set to true if
+ * -nodeprecated option is used. Default is generate deprected API
+ * information.
+ */
+ public boolean nodeprecated = false;
+
+ /**
+ * The catalog of classes specified on the command-line
+ */
+ public TypeElementCatalog typeElementCatalog;
+
+ /**
+ * True if user wants to suppress time stamp in output.
+ * Default is false.
+ */
+ public boolean notimestamp= false;
+
+ /**
+ * The package grouping instance.
+ */
+ public final Group group = new Group(this);
+
+ /**
+ * The tracker of external package links.
+ */
+ public final Extern extern = new Extern(this);
+
+ public Reporter reporter;
+
+ public Locale locale;
+
+ /**
+ * Suppress all messages
+ */
+ public boolean quiet = false;
+
+ private String urlForLink;
+
+ private String pkglistUrlForLink;
+
+ private String urlForLinkOffline;
+
+ private String pkglistUrlForLinkOffline;
+
+ public boolean dumpOnError = false;
+
+ private List<GroupContainer> groups;
+
+ private final Map<TypeElement, EnumMap<Kind, Reference<VisibleMemberMap>>> typeElementMemberCache;
+
+ public abstract Messages getMessages();
+ public abstract Resources getResources();
+
+ /**
+ * Return the build date for the doclet.
+ *
+ * @return the build date
+ */
+ public abstract String getDocletSpecificBuildDate();
+
+ /**
+ * This method should be defined in all those doclets (configurations),
+ * which want to derive themselves from this BaseConfiguration. This method
+ * can be used to finish up the options setup.
+ *
+ * @return true if successful and false otherwise
+ */
+
+ public abstract boolean finishOptionSettings();
+
+ public CommentUtils cmtUtils;
+
+ /**
+ * A sorted set of included packages.
+ */
+ public SortedSet<PackageElement> packages = null;
+
+ public OverviewElement overviewElement;
+
+ // The following three fields provide caches for use by all instances of VisibleMemberMap.
+ public final Map<TypeElement, List<Element>> propertiesCache = new HashMap<>();
+ public final Map<Element, Element> classPropertiesMap = new HashMap<>();
+ public final Map<Element, GetterSetter> getterSetterMap = new HashMap<>();
+
+ public DocFileFactory docFileFactory;
+
+ /**
+ * A sorted map, giving the (specified|included|other) packages for each module.
+ */
+ public SortedMap<ModuleElement, Set<PackageElement>> modulePackages;
+
+ /**
+ * The list of known modules, that should be documented.
+ */
+ public SortedSet<ModuleElement> modules;
+
+ protected static final String sharedResourceBundleName =
+ "jdk.javadoc.internal.doclets.toolkit.resources.doclets";
+ /**
+ * Constructs the configurations needed by the doclet.
+ * @param doclet the doclet that created this configuration
+ */
+ public BaseConfiguration(Doclet doclet) {
+ this.doclet = doclet;
+ excludedDocFileDirs = new HashSet<>();
+ excludedQualifiers = new HashSet<>();
+ setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH);
+ metakeywords = new MetaKeywords(this);
+ groups = new ArrayList<>(0);
+ typeElementMemberCache = new HashMap<>();
+ }
+
+ private boolean initialized = false;
+
+ protected void initConfiguration(DocletEnvironment docEnv) {
+ if (initialized) {
+ throw new IllegalStateException("configuration previously initialized");
+ }
+ initialized = true;
+ this.docEnv = docEnv;
+ overviewElement = new OverviewElement(docEnv);
+ Splitter specifiedSplitter = new Splitter(docEnv, false);
+ specifiedModuleElements = Collections.unmodifiableSet(specifiedSplitter.mset);
+ specifiedPackageElements = Collections.unmodifiableSet(specifiedSplitter.pset);
+ specifiedTypeElements = Collections.unmodifiableSet(specifiedSplitter.tset);
+
+ Splitter includedSplitter = new Splitter(docEnv, true);
+ includedModuleElements = Collections.unmodifiableSet(includedSplitter.mset);
+ includedPackageElements = Collections.unmodifiableSet(includedSplitter.pset);
+ includedTypeElements = Collections.unmodifiableSet(includedSplitter.tset);
+ }
+
+ /**
+ * Return the builder factory for this doclet.
+ *
+ * @return the builder factory for this doclet.
+ */
+ public BuilderFactory getBuilderFactory() {
+ if (builderFactory == null) {
+ builderFactory = new BuilderFactory(this);
+ }
+ return builderFactory;
+ }
+
+ public Reporter getReporter() {
+ return this.reporter;
+ }
+
+ private Set<ModuleElement> specifiedModuleElements;
+ public Set<ModuleElement> getSpecifiedModuleElements() {
+ return specifiedModuleElements;
+ }
+
+ private Set<PackageElement> specifiedPackageElements;
+ public Set<PackageElement> getSpecifiedPackageElements() {
+ return specifiedPackageElements;
+ }
+
+ private Set<TypeElement> specifiedTypeElements;
+ public Set<TypeElement> getSpecifiedTypeElements() {
+ return specifiedTypeElements;
+ }
+
+ private Set<ModuleElement> includedModuleElements;
+ public Set<ModuleElement> getIncludedModuleElements() {
+ return includedModuleElements;
+ }
+
+ private Set<PackageElement> includedPackageElements;
+ public Set<PackageElement> getIncludedPackageElements() {
+ return includedPackageElements;
+ }
+
+ private Set<TypeElement> includedTypeElements;
+ public Set<TypeElement> getIncludedTypeElements() {
+ return includedTypeElements;
+ }
+
+ private void initModules() {
+ // Build the modules structure used by the doclet
+ modules = new TreeSet<>(utils.makeModuleComparator());
+ modules.addAll(getSpecifiedModuleElements());
+
+ modulePackages = new TreeMap<>(utils.makeModuleComparator());
+ for (PackageElement p: packages) {
+ ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p);
+ if (mdle != null && !mdle.isUnnamed()) {
+ Set<PackageElement> s = modulePackages
+ .computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator()));
+ s.add(p);
+ }
+ }
+
+ for (PackageElement p: getIncludedPackageElements()) {
+ ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p);
+ if (mdle != null && !mdle.isUnnamed()) {
+ Set<PackageElement> s = modulePackages
+ .computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator()));
+ s.add(p);
+ }
+ }
+
+ // add entries for modules which may not have exported packages
+ modules.forEach((ModuleElement mdle) -> {
+ modulePackages.computeIfAbsent(mdle, m -> Collections.emptySet());
+ });
+
+ modules.addAll(modulePackages.keySet());
+ showModules = !modules.isEmpty();
+ for (Set<PackageElement> pkgs : modulePackages.values()) {
+ packages.addAll(pkgs);
+ }
+ }
+
+ private void initPackages() {
+ packages = new TreeSet<>(utils.makePackageComparator());
+ // add all the included packages
+ packages.addAll(includedPackageElements);
+ }
+
+ public Set<Doclet.Option> getSupportedOptions() {
+ Resources resources = getResources();
+ Doclet.Option[] options = {
+ new Option(resources, "-author") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ showauthor = true;
+ return true;
+ }
+ },
+ new Option(resources, "-d", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ destDirName = addTrailingFileSep(args.get(0));
+ return true;
+ }
+ },
+ new Option(resources, "-docencoding", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ docencoding = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-docfilessubdirs") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ copydocfilesubdirs = true;
+ return true;
+ }
+ },
+ new Hidden(resources, "-encoding", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ encoding = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-excludedocfilessubdir", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ addToSet(excludedDocFileDirs, args.get(0));
+ return true;
+ }
+ },
+ new Option(resources, "-group", 2) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ groups.add(new GroupContainer(args.get(0), args.get(1)));
+ return true;
+ }
+ },
+ new Option(resources, "--javafx -javafx") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ javafx = true;
+ return true;
+ }
+ },
+ new Option(resources, "-keywords") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ keywords = true;
+ return true;
+ }
+ },
+ new Option(resources, "-link", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ urlForLink = args.get(0);
+ pkglistUrlForLink = urlForLink;
+ return true;
+ }
+ },
+ new Option(resources, "-linksource") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ linksource = true;
+ return true;
+ }
+ },
+ new Option(resources, "-linkoffline", 2) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ urlForLinkOffline = args.get(0);
+ pkglistUrlForLinkOffline = args.get(1);
+ return true;
+ }
+ },
+ new Option(resources, "-nocomment") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ nocomment = true;
+ return true;
+ }
+ },
+ new Option(resources, "-nodeprecated") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ nodeprecated = true;
+ return true;
+ }
+ },
+ new Option(resources, "-nosince") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ nosince = true;
+ return true;
+ }
+ },
+ new Option(resources, "-notimestamp") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ notimestamp = true;
+ return true;
+ }
+ },
+ new Option(resources, "-noqualifier", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ addToSet(excludedQualifiers, args.get(0));
+ return true;
+ }
+ },
+ new Hidden(resources, "-quiet") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ quiet = true;
+ return true;
+ }
+ },
+ new Option(resources, "-serialwarn") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ serialwarn = true;
+ return true;
+ }
+ },
+ new Option(resources, "-sourcetab", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ linksource = true;
+ try {
+ setTabWidth(Integer.parseInt(args.get(0)));
+ } catch (NumberFormatException e) {
+ //Set to -1 so that warning will be printed
+ //to indicate what is valid argument.
+ sourcetab = -1;
+ }
+ if (sourcetab <= 0) {
+ getMessages().warning("doclet.sourcetab_warning");
+ setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH);
+ }
+ return true;
+ }
+ },
+ new Option(resources, "-tag", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ ArrayList<String> list = new ArrayList<>();
+ list.add(opt);
+ list.add(args.get(0));
+ customTagStrs.add(list);
+ return true;
+ }
+ },
+ new Option(resources, "-taglet", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ ArrayList<String> list = new ArrayList<>();
+ list.add(opt);
+ list.add(args.get(0));
+ customTagStrs.add(list);
+ return true;
+ }
+ },
+ new Option(resources, "-tagletpath", 1) {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ tagletpath = args.get(0);
+ return true;
+ }
+ },
+ new Option(resources, "-version") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ showversion = true;
+ return true;
+ }
+ },
+ new Hidden(resources, "--dump-on-error") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ dumpOnError = true;
+ return true;
+ }
+ },
+ new Option(resources, "--allow-script-in-comments") {
+ @Override
+ public boolean process(String opt, List<String> args) {
+ allowScriptInComments = true;
+ return true;
+ }
+ }
+ };
+ Set<Doclet.Option> set = new TreeSet<>();
+ set.addAll(Arrays.asList(options));
+ return set;
+ }
+
+ final LinkedHashSet<List<String>> customTagStrs = new LinkedHashSet<>();
+
+ /*
+ * when this is called all the option have been set, this method,
+ * initializes certain components before anything else is started.
+ */
+ private void finishOptionSettings0() throws DocletException {
+ initDestDirectory();
+ if (urlForLink != null && pkglistUrlForLink != null)
+ extern.link(urlForLink, pkglistUrlForLink, reporter, false);
+ if (urlForLinkOffline != null && pkglistUrlForLinkOffline != null)
+ extern.link(urlForLinkOffline, pkglistUrlForLinkOffline, reporter, true);
+ if (docencoding == null) {
+ docencoding = encoding;
+ }
+ typeElementCatalog = new TypeElementCatalog(includedTypeElements, this);
+ initTagletManager(customTagStrs);
+ groups.stream().forEach((grp) -> {
+ if (showModules) {
+ group.checkModuleGroups(grp.value1, grp.value2);
+ } else {
+ group.checkPackageGroups(grp.value1, grp.value2);
+ }
+ });
+ }
+
+ /**
+ * Set the command line options supported by this configuration.
+ *
+ * @return true if the options are set successfully
+ * @throws DocletException if there is a problem while setting the options
+ */
+ public boolean setOptions() throws DocletException {
+ initPackages();
+ initModules();
+ finishOptionSettings0();
+ if (!finishOptionSettings())
+ return false;
+
+ return true;
+ }
+
+ private void initDestDirectory() throws DocletException {
+ if (!destDirName.isEmpty()) {
+ DocFile destDir = DocFile.createFileForDirectory(this, destDirName);
+ if (!destDir.exists()) {
+ //Create the output directory (in case it doesn't exist yet)
+ reporter.print(NOTE, getText("doclet.dest_dir_create", destDirName));
+ destDir.mkdirs();
+ } else if (!destDir.isDirectory()) {
+ throw new SimpleDocletException(getText(
+ "doclet.destination_directory_not_directory_0",
+ destDir.getPath()));
+ } else if (!destDir.canWrite()) {
+ throw new SimpleDocletException(getText(
+ "doclet.destination_directory_not_writable_0",
+ destDir.getPath()));
+ }
+ }
+ DocFileFactory.getFactory(this).setDestDir(destDirName);
+ }
+
+ /**
+ * Initialize the taglet manager. The strings to initialize the simple custom tags should
+ * be in the following format: "[tag name]:[location str]:[heading]".
+ *
+ * @param customTagStrs the set two dimensional arrays of strings. These arrays contain
+ * either -tag or -taglet arguments.
+ */
+ private void initTagletManager(Set<List<String>> customTagStrs) {
+ tagletManager = tagletManager == null ?
+ new TagletManager(nosince, showversion, showauthor, javafx, this) :
+ tagletManager;
+ for (List<String> args : customTagStrs) {
+ if (args.get(0).equals("-taglet")) {
+ tagletManager.addCustomTag(args.get(1), getFileManager(), tagletpath);
+ continue;
+ }
+ List<String> tokens = tokenize(args.get(1), TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3);
+ if (tokens.size() == 1) {
+ String tagName = args.get(1);
+ if (tagletManager.isKnownCustomTag(tagName)) {
+ //reorder a standard tag
+ tagletManager.addNewSimpleCustomTag(tagName, null, "");
+ } else {
+ //Create a simple tag with the heading that has the same name as the tag.
+ StringBuilder heading = new StringBuilder(tagName + ":");
+ heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0)));
+ tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a");
+ }
+ } else if (tokens.size() == 2) {
+ //Add simple taglet without heading, probably to excluding it in the output.
+ tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(1), "");
+ } else if (tokens.size() >= 3) {
+ tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(2), tokens.get(1));
+ } else {
+ Messages messages = getMessages();
+ messages.error("doclet.Error_invalid_custom_tag_argument", args.get(1));
+ }
+ }
+ }
+
+ /**
+ * Given a string, return an array of tokens. The separator can be escaped
+ * with the '\' character. The '\' character may also be escaped by the
+ * '\' character.
+ *
+ * @param s the string to tokenize.
+ * @param separator the separator char.
+ * @param maxTokens the maximum number of tokens returned. If the
+ * max is reached, the remaining part of s is appended
+ * to the end of the last token.
+ *
+ * @return an array of tokens.
+ */
+ private List<String> tokenize(String s, char separator, int maxTokens) {
+ List<String> tokens = new ArrayList<>();
+ StringBuilder token = new StringBuilder ();
+ boolean prevIsEscapeChar = false;
+ for (int i = 0; i < s.length(); i += Character.charCount(i)) {
+ int currentChar = s.codePointAt(i);
+ if (prevIsEscapeChar) {
+ // Case 1: escaped character
+ token.appendCodePoint(currentChar);
+ prevIsEscapeChar = false;
+ } else if (currentChar == separator && tokens.size() < maxTokens-1) {
+ // Case 2: separator
+ tokens.add(token.toString());
+ token = new StringBuilder();
+ } else if (currentChar == '\\') {
+ // Case 3: escape character
+ prevIsEscapeChar = true;
+ } else {
+ // Case 4: regular character
+ token.appendCodePoint(currentChar);
+ }
+ }
+ if (token.length() > 0) {
+ tokens.add(token.toString());
+ }
+ return tokens;
+ }
+
+ private void addToSet(Set<String> s, String str){
+ StringTokenizer st = new StringTokenizer(str, ":");
+ String current;
+ while(st.hasMoreTokens()){
+ current = st.nextToken();
+ s.add(current);
+ }
+ }
+
+ /**
+ * Add a trailing file separator, if not found. Remove superfluous
+ * file separators if any. Preserve the front double file separator for
+ * UNC paths.
+ *
+ * @param path Path under consideration.
+ * @return String Properly constructed path string.
+ */
+ public static String addTrailingFileSep(String path) {
+ String fs = System.getProperty("file.separator");
+ String dblfs = fs + fs;
+ int indexDblfs;
+ while ((indexDblfs = path.indexOf(dblfs, 1)) >= 0) {
+ path = path.substring(0, indexDblfs) +
+ path.substring(indexDblfs + fs.length());
+ }
+ if (!path.endsWith(fs))
+ path += fs;
+ return path;
+ }
+
+ /**
+ *
+ * This checks for the validity of the options used by the user.
+ * As of this writing, this checks only docencoding.
+ *
+ * @return true if all the options are valid.
+ */
+ public boolean generalValidOptions() {
+ if (docencoding != null) {
+ if (!checkOutputFileEncoding(docencoding)) {
+ return false;
+ }
+ }
+ if (docencoding == null && (encoding != null && !encoding.isEmpty())) {
+ if (!checkOutputFileEncoding(encoding)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Check the validity of the given Source or Output File encoding on this
+ * platform.
+ *
+ * @param docencoding output file encoding.
+ * @param reporter used to report errors.
+ */
+ private boolean checkOutputFileEncoding(String docencoding) {
+ OutputStream ost= new ByteArrayOutputStream();
+ OutputStreamWriter osw = null;
+ try {
+ osw = new OutputStreamWriter(ost, docencoding);
+ } catch (UnsupportedEncodingException exc) {
+ reporter.print(ERROR, getText("doclet.Encoding_not_supported", docencoding));
+ return false;
+ } finally {
+ try {
+ if (osw != null) {
+ osw.close();
+ }
+ } catch (IOException exc) {
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return true if the given doc-file subdirectory should be excluded and
+ * false otherwise.
+ *
+ * @param docfilesubdir the doc-files subdirectory to check.
+ * @return true if the directory is excluded.
+ */
+ public boolean shouldExcludeDocFileDir(String docfilesubdir){
+ return excludedDocFileDirs.contains(docfilesubdir);
+ }
+
+ /**
+ * Return true if the given qualifier should be excluded and false otherwise.
+ *
+ * @param qualifier the qualifier to check.
+ * @return true if the qualifier should be excluded
+ */
+ public boolean shouldExcludeQualifier(String qualifier){
+ if (excludedQualifiers.contains("all") ||
+ excludedQualifiers.contains(qualifier) ||
+ excludedQualifiers.contains(qualifier + ".*")) {
+ return true;
+ } else {
+ int index = -1;
+ while ((index = qualifier.indexOf(".", index + 1)) != -1) {
+ if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Return the qualified name of the Element if its qualifier is not excluded.
+ * Otherwise return the unqualified Element name.
+ *
+ * @param te the TypeElement to check.
+ * @return the class name
+ */
+ public String getClassName(TypeElement te) {
+ PackageElement pkg = utils.containingPackage(te);
+ return shouldExcludeQualifier(utils.getPackageName(pkg))
+ ? utils.getSimpleName(te)
+ : utils.getFullyQualifiedName(te);
+ }
+
+ /**
+ * Convenience method to obtain a resource from the doclet's
+ * {@link Resources resources}.
+ * Equivalent to <code>getResources.getText(key);</code>.
+ *
+ * @param key the key for the desired string
+ * @return the string for the given key
+ * @throws MissingResourceException if the key is not found in either
+ * bundle.
+ */
+ public abstract String getText(String key);
+
+ /**
+ * Convenience method to obtain a resource from the doclet's
+ * {@link Resources resources}.
+ * Equivalent to <code>getResources.getText(key, args);</code>.
+ *
+ * @param key the key for the desired string
+ * @param args values to be substituted into the resulting string
+ * @return the string for the given key
+ * @throws MissingResourceException if the key is not found in either
+ * bundle.
+ */
+ public abstract String getText(String key, String... args);
+
+ /**
+ * Convenience method to obtain a resource from the doclet's
+ * {@link Resources resources} as a {@code Content} object.
+ *
+ * @param key the key for the desired string
+ * @return a content tree for the text
+ */
+ public abstract Content getContent(String key);
+
+ /**
+ * Convenience method to obtain a resource from the doclet's
+ * {@link Resources resources} as a {@code Content} object.
+ *
+ * @param key the key for the desired string
+ * @param o string or content argument added to configuration text
+ * @return a content tree for the text
+ */
+ public abstract Content getContent(String key, Object o);
+
+ /**
+ * Convenience method to obtain a resource from the doclet's
+ * {@link Resources resources} as a {@code Content} object.
+ *
+ * @param key the key for the desired string
+ * @param o1 resource argument
+ * @param o2 resource argument
+ * @return a content tree for the text
+ */
+ public abstract Content getContent(String key, Object o1, Object o2);
+
+ /**
+ * Get the configuration string as a content.
+ *
+ * @param key the key for the desired string
+ * @param o0 string or content argument added to configuration text
+ * @param o1 string or content argument added to configuration text
+ * @param o2 string or content argument added to configuration text
+ * @return a content tree for the text
+ */
+ public abstract Content getContent(String key, Object o0, Object o1, Object o2);
+
+ /**
+ * Return true if the TypeElement element is getting documented, depending upon
+ * -nodeprecated option and the deprecation information. Return true if
+ * -nodeprecated is not used. Return false if -nodeprecated is used and if
+ * either TypeElement element is deprecated or the containing package is deprecated.
+ *
+ * @param te the TypeElement for which the page generation is checked
+ * @return true if it is a generated doc.
+ */
+ public boolean isGeneratedDoc(TypeElement te) {
+ if (!nodeprecated) {
+ return true;
+ }
+ return !(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te)));
+ }
+
+ /**
+ * Return the doclet specific instance of a writer factory.
+ *
+ * @return the {@link WriterFactory} for the doclet.
+ */
+ public abstract WriterFactory getWriterFactory();
+
+ /**
+ * Return the input stream to the builder XML.
+ *
+ * @return the input steam to the builder XML.
+ * @throws DocFileIOException when the given XML file cannot be found or opened.
+ */
+ public InputStream getBuilderXML() throws DocFileIOException {
+ return builderXMLPath == null ?
+ BaseConfiguration.class.getResourceAsStream(DEFAULT_BUILDER_XML) :
+ DocFile.createFileForInput(this, builderXMLPath).openInputStream();
+ }
+
+ /**
+ * Return the Locale for this document.
+ *
+ * @return the current locale
+ */
+ public abstract Locale getLocale();
+
+ /**
+ * Return the path of the overview file and null if it does not exist.
+ *
+ * @return the path of the overview file.
+ */
+ public abstract JavaFileObject getOverviewPath();
+
+ /**
+ * Return the current file manager.
+ *
+ * @return JavaFileManager
+ */
+ public abstract JavaFileManager getFileManager();
+
+ private void setTabWidth(int n) {
+ sourcetab = n;
+ tabSpaces = String.format("%" + n + "s", "");
+ }
+
+ public abstract boolean showMessage(DocTreePath path, String key);
+
+ public abstract boolean showMessage(Element e, String key);
+
+ public static abstract class Option implements Doclet.Option, Comparable<Option> {
+ private final String[] names;
+ private final String parameters;
+ private final String description;
+ private final int argCount;
+
+ protected Option(Resources resources, String name, int argCount) {
+ this(resources, null, name, argCount);
+ }
+
+ protected Option(Resources resources, String keyBase, String name, int argCount) {
+ this.names = name.trim().split("\\s+");
+ if (keyBase == null) {
+ keyBase = "doclet.usage." + names[0].toLowerCase().replaceAll("^-+", "");
+ }
+ String desc = getOptionsMessage(resources, keyBase + ".description");
+ if (desc.isEmpty()) {
+ this.description = "<MISSING KEY>";
+ this.parameters = "<MISSING KEY>";
+ } else {
+ this.description = desc;
+ this.parameters = getOptionsMessage(resources, keyBase + ".parameters");
+ }
+ this.argCount = argCount;
+ }
+
+ protected Option(Resources resources, String name) {
+ this(resources, name, 0);
+ }
+
+ private String getOptionsMessage(Resources resources, String key) {
+ try {
+ return resources.getText(key);
+ } catch (MissingResourceException ignore) {
+ return "";
+ }
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public Option.Kind getKind() {
+ return Doclet.Option.Kind.STANDARD;
+ }
+
+ @Override
+ public List<String> getNames() {
+ return Arrays.asList(names);
+ }
+
+ @Override
+ public String getParameters() {
+ return parameters;
+ }
+
+ @Override
+ public String toString() {
+ return Arrays.toString(names);
+ }
+
+ @Override
+ public int getArgumentCount() {
+ return argCount;
+ }
+
+ public boolean matches(String option) {
+ for (String name : names) {
+ boolean matchCase = name.startsWith("--");
+ if (option.startsWith("--") && option.contains("=")) {
+ return name.equals(option.substring(option.indexOf("=") + 1));
+ } else if (matchCase) {
+ return name.equals(option);
+ }
+ return name.toLowerCase().equals(option.toLowerCase());
+ }
+ return false;
+ }
+
+ @Override
+ public int compareTo(Option that) {
+ return this.getNames().get(0).compareTo(that.getNames().get(0));
+ }
+ }
+
+ public abstract class XOption extends Option {
+
+ public XOption(Resources resources, String prefix, String name, int argCount) {
+ super(resources, prefix, name, argCount);
+ }
+
+ public XOption(Resources resources, String name, int argCount) {
+ super(resources, name, argCount);
+ }
+
+ public XOption(Resources resources, String name) {
+ this(resources, name, 0);
+ }
+
+ @Override
+ public Option.Kind getKind() {
+ return Doclet.Option.Kind.EXTENDED;
+ }
+ }
+
+ public abstract class Hidden extends Option {
+
+ public Hidden(Resources resources, String name, int argCount) {
+ super(resources, name, argCount);
+ }
+
+ public Hidden(Resources resources, String name) {
+ this(resources, name, 0);
+ }
+
+ @Override
+ public Option.Kind getKind() {
+ return Doclet.Option.Kind.OTHER;
+ }
+ }
+
+ /*
+ * Stores a pair of Strings.
+ */
+ protected static class GroupContainer {
+ final String value1;
+ final String value2;
+ public GroupContainer(String value1, String value2) {
+ this.value1 = value1;
+ this.value2 = value2;
+ }
+ }
+
+ /*
+ * Splits the elements in a collection to its individual
+ * collection.
+ */
+ static private class Splitter {
+
+ final Set<ModuleElement> mset = new LinkedHashSet<>();
+ final Set<PackageElement> pset = new LinkedHashSet<>();
+ final Set<TypeElement> tset = new LinkedHashSet<>();
+
+ Splitter(DocletEnvironment docEnv, boolean included) {
+
+ Set<? extends Element> inset = included
+ ? docEnv.getIncludedElements()
+ : docEnv.getSpecifiedElements();
+
+ for (Element e : inset) {
+ new SimpleElementVisitor9<Void, Void>() {
+ @Override
+ @DefinedBy(Api.LANGUAGE_MODEL)
+ public Void visitModule(ModuleElement e, Void p) {
+ mset.add(e);
+ return null;
+ }
+
+ @Override
+ @DefinedBy(Api.LANGUAGE_MODEL)
+ public Void visitPackage(PackageElement e, Void p) {
+ pset.add(e);
+ return null;
+ }
+
+ @Override
+ @DefinedBy(Api.LANGUAGE_MODEL)
+ public Void visitType(TypeElement e, Void p) {
+ tset.add(e);
+ return null;
+ }
+
+ @Override
+ @DefinedBy(Api.LANGUAGE_MODEL)
+ protected Void defaultAction(Element e, Void p) {
+ throw new AssertionError("unexpected element: " + e);
+ }
+
+ }.visit(e);
+ }
+ }
+ }
+
+ /**
+ * Returns whether or not to allow JavaScript in comments.
+ * Default is off; can be set true from a command line option.
+ * @return the allowScriptInComments
+ */
+ public boolean isAllowScriptInComments() {
+ return allowScriptInComments;
+ }
+
+ public VisibleMemberMap getVisibleMemberMap(TypeElement te, VisibleMemberMap.Kind kind) {
+ EnumMap<Kind, Reference<VisibleMemberMap>> cacheMap = typeElementMemberCache
+ .computeIfAbsent(te, k -> new EnumMap<>(VisibleMemberMap.Kind.class));
+
+ Reference<VisibleMemberMap> vmapRef = cacheMap.get(kind);
+ // recompute, if referent has been garbage collected
+ VisibleMemberMap vMap = vmapRef == null ? null : vmapRef.get();
+ if (vMap == null) {
+ vMap = new VisibleMemberMap(te, kind, this);
+ cacheMap.put(kind, new SoftReference<>(vMap));
+ }
+ return vMap;
+ }
+}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/CommentUtils.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/CommentUtils.java Mon Jun 05 13:45:34 2017 -0700
@@ -64,13 +64,13 @@
public class CommentUtils {
- final Configuration configuration;
+ final BaseConfiguration configuration;
final DocTreeFactory treeFactory;
final HashMap<Element, DocCommentDuo> dcTreesMap = new HashMap<>();
final DocTrees trees;
final Elements elementUtils;
- protected CommentUtils(Configuration configuration) {
+ protected CommentUtils(BaseConfiguration configuration) {
this.configuration = configuration;
trees = configuration.docEnv.getDocTrees();
treeFactory = trees.getDocTreeFactory();
@@ -110,7 +110,7 @@
return (DocTree) text;
}
- public void setEnumValuesTree(Configuration config, Element e) {
+ public void setEnumValuesTree(BaseConfiguration config, Element e) {
Utils utils = config.utils;
String klassName = utils.getSimpleName(utils.getEnclosingTypeElement(e));
@@ -126,7 +126,7 @@
dcTreesMap.put(e, new DocCommentDuo(null, docTree));
}
- public void setEnumValueOfTree(Configuration config, Element e) {
+ public void setEnumValueOfTree(BaseConfiguration config, Element e) {
List<DocTree> fullBody = new ArrayList<>();
fullBody.add(treeFactory.newTextTree(config.getText("doclet.enum_valueof_doc.fullbody")));
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java Sat Jun 03 02:45:43 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1289 +0,0 @@
-/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.javadoc.internal.doclets.toolkit;
-
-import java.io.*;
-import java.lang.ref.*;
-import java.util.*;
-
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ModuleElement;
-import javax.lang.model.element.PackageElement;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.util.SimpleElementVisitor9;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-
-import com.sun.source.util.DocTreePath;
-import com.sun.tools.javac.util.DefinedBy;
-import com.sun.tools.javac.util.DefinedBy.Api;
-import jdk.javadoc.doclet.Doclet;
-import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.doclet.Reporter;
-import jdk.javadoc.internal.doclets.toolkit.builders.BuilderFactory;
-import jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager;
-import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
-import jdk.javadoc.internal.doclets.toolkit.util.DocFileFactory;
-import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
-import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
-import jdk.javadoc.internal.doclets.toolkit.util.Extern;
-import jdk.javadoc.internal.doclets.toolkit.util.Group;
-import jdk.javadoc.internal.doclets.toolkit.util.MetaKeywords;
-import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException;
-import jdk.javadoc.internal.doclets.toolkit.util.TypeElementCatalog;
-import jdk.javadoc.internal.doclets.toolkit.util.Utils;
-import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
-import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.GetterSetter;
-import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind;
-
-import static javax.tools.Diagnostic.Kind.*;
-
-/**
- * Configure the output based on the options. Doclets should sub-class
- * Configuration, to configure and add their own options. This class contains
- * all user options which are supported by the 1.1 doclet and the standard
- * doclet.
- *
- * <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
- * deletion without notice.</b>
- *
- * @author Robert Field.
- * @author Atul Dambalkar.
- * @author Jamie Ho
- */
-public abstract class Configuration {
- /**
- * The doclet that created this configuration.
- */
- public final Doclet doclet;
-
- /**
- * The factory for builders.
- */
- protected BuilderFactory builderFactory;
-
- /**
- * The taglet manager.
- */
- public TagletManager tagletManager;
-
- /**
- * The path to the builder XML input file.
- */
- public String builderXMLPath;
-
- /**
- * The default path to the builder XML.
- */
- public static final String DEFAULT_BUILDER_XML = "resources/doclet.xml";
-
- /**
- * The path to Taglets
- */
- public String tagletpath = null;
-
- /**
- * This is true if option "-serialwarn" is used. Defualt value is false to
- * suppress excessive warnings about serial tag.
- */
- public boolean serialwarn = false;
-
- /**
- * The specified amount of space between tab stops.
- */
- public int sourcetab;
-
- public String tabSpaces;
-
- /**
- * True if we should generate browsable sources.
- */
- public boolean linksource = false;
-
- /**
- * True if command line option "-nosince" is used. Default value is
- * false.
- */
- public boolean nosince = false;
-
- /**
- * True if we should recursively copy the doc-file subdirectories
- */
- public boolean copydocfilesubdirs = false;
-
- /**
- * Maintain backward compatibility with previous javadoc version
- */
- public boolean backwardCompatibility = true;
-
- /**
- * The META charset tag used for cross-platform viewing.
- */
- public String charset = "";
-
- /**
- * 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 = false;
-
- /**
- * The meta tag keywords instance.
- */
- public final MetaKeywords metakeywords;
-
- /**
- * The set of doc-file subdirectories to exclude
- */
- protected Set<String> excludedDocFileDirs;
-
- /**
- * The set of qualifiers to exclude
- */
- protected Set<String> excludedQualifiers;
-
- /**
- * The doclet environment.
- */
- public DocletEnvironment docEnv;
-
- /**
- * An utility class for commonly used helpers
- */
- public Utils utils;
-
- /**
- * All the temporary accessors to javac internals.
- */
- public WorkArounds workArounds;
-
- /**
- * Destination directory name, in which doclet will generate the entire
- * documentation. Default is current directory.
- */
- public String destDirName = "";
-
- /**
- * Destination directory name, in which doclet will copy the doc-files to.
- */
- public String docFileDestDirName = "";
-
- /**
- * Encoding for this document. Default is default encoding for this
- * platform.
- */
- public String docencoding = null;
-
- /**
- * True if user wants to suppress descriptions and tags.
- */
- public boolean nocomment = false;
-
- /**
- * Encoding for this document. Default is default encoding for this
- * platform.
- */
- public String encoding = null;
-
- /**
- * 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 = false;
-
- /**
- * Generate documentation for JavaFX getters and setters automatically
- * by copying it from the appropriate property definition.
- */
- public boolean javafx = false;
-
- /**
- * 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</code> is set to true if -version option is
- * used.Default is don't show version information.
- */
- public boolean showversion = false;
-
- /**
- * Allow JavaScript in doc comments.
- */
- private boolean allowScriptInComments = false;
-
- /**
- * Sourcepath from where to read the source files. Default is classpath.
- *
- */
- public String sourcepath = "";
-
- /**
- * Generate modules documentation if more than one module is present.
- */
- public boolean showModules = false;
-
- /**
- * Don't generate deprecated API information at all, if -nodeprecated
- * option is used. <code>nodepracted</code> is set to true if
- * -nodeprecated option is used. Default is generate deprected API
- * information.
- */
- public boolean nodeprecated = false;
-
- /**
- * The catalog of classes specified on the command-line
- */
- public TypeElementCatalog typeElementCatalog;
-
- /**
- * True if user wants to suppress time stamp in output.
- * Default is false.
- */
- public boolean notimestamp= false;
-
- /**
- * The package grouping instance.
- */
- public final Group group = new Group(this);
-
- /**
- * The tracker of external package links.
- */
- public final Extern extern = new Extern(this);
-
- public Reporter reporter;
-
- public Locale locale;
-
- /**
- * Suppress all messages
- */
- public boolean quiet = false;
-
- private String urlForLink;
-
- private String pkglistUrlForLink;
-
- private String urlForLinkOffline;
-
- private String pkglistUrlForLinkOffline;
-
- public boolean dumpOnError = false;
-
- private List<GroupContainer> groups;
-
- private final Map<TypeElement, EnumMap<Kind, Reference<VisibleMemberMap>>> typeElementMemberCache;
-
- public abstract Messages getMessages();
- public abstract Resources getResources();
-
- /**
- * Return the build date for the doclet.
- *
- * @return the build date
- */
- public abstract String getDocletSpecificBuildDate();
-
- /**
- * This method should be defined in all those doclets (configurations),
- * which want to derive themselves from this Configuration. This method
- * can be used to finish up the options setup.
- *
- * @return true if successful and false otherwise
- */
-
- public abstract boolean finishOptionSettings();
-
- public CommentUtils cmtUtils;
-
- /**
- * A sorted set of included packages.
- */
- public SortedSet<PackageElement> packages = null;
-
- public OverviewElement overviewElement;
-
- // The following three fields provide caches for use by all instances of VisibleMemberMap.
- public final Map<TypeElement, List<Element>> propertiesCache = new HashMap<>();
- public final Map<Element, Element> classPropertiesMap = new HashMap<>();
- public final Map<Element, GetterSetter> getterSetterMap = new HashMap<>();
-
- public DocFileFactory docFileFactory;
-
- /**
- * A sorted map, giving the (specified|included|other) packages for each module.
- */
- public SortedMap<ModuleElement, Set<PackageElement>> modulePackages;
-
- /**
- * The list of known modules, that should be documented.
- */
- public SortedSet<ModuleElement> modules;
-
- protected static final String sharedResourceBundleName =
- "jdk.javadoc.internal.doclets.toolkit.resources.doclets";
- /**
- * Constructs the configurations needed by the doclet.
- * @param doclet the doclet that created this configuration
- */
- public Configuration(Doclet doclet) {
- this.doclet = doclet;
- excludedDocFileDirs = new HashSet<>();
- excludedQualifiers = new HashSet<>();
- setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH);
- metakeywords = new MetaKeywords(this);
- groups = new ArrayList<>(0);
- typeElementMemberCache = new HashMap<>();
- }
-
- private boolean initialized = false;
-
- protected void initConfiguration(DocletEnvironment docEnv) {
- if (initialized) {
- throw new IllegalStateException("configuration previously initialized");
- }
- initialized = true;
- this.docEnv = docEnv;
- overviewElement = new OverviewElement(docEnv);
- Splitter specifiedSplitter = new Splitter(docEnv, false);
- specifiedModuleElements = Collections.unmodifiableSet(specifiedSplitter.mset);
- specifiedPackageElements = Collections.unmodifiableSet(specifiedSplitter.pset);
- specifiedTypeElements = Collections.unmodifiableSet(specifiedSplitter.tset);
-
- Splitter includedSplitter = new Splitter(docEnv, true);
- includedModuleElements = Collections.unmodifiableSet(includedSplitter.mset);
- includedPackageElements = Collections.unmodifiableSet(includedSplitter.pset);
- includedTypeElements = Collections.unmodifiableSet(includedSplitter.tset);
- }
-
- /**
- * Return the builder factory for this doclet.
- *
- * @return the builder factory for this doclet.
- */
- public BuilderFactory getBuilderFactory() {
- if (builderFactory == null) {
- builderFactory = new BuilderFactory(this);
- }
- return builderFactory;
- }
-
- public Reporter getReporter() {
- return this.reporter;
- }
-
- private Set<ModuleElement> specifiedModuleElements;
- public Set<ModuleElement> getSpecifiedModuleElements() {
- return specifiedModuleElements;
- }
-
- private Set<PackageElement> specifiedPackageElements;
- public Set<PackageElement> getSpecifiedPackageElements() {
- return specifiedPackageElements;
- }
-
- private Set<TypeElement> specifiedTypeElements;
- public Set<TypeElement> getSpecifiedTypeElements() {
- return specifiedTypeElements;
- }
-
- private Set<ModuleElement> includedModuleElements;
- public Set<ModuleElement> getIncludedModuleElements() {
- return includedModuleElements;
- }
-
- private Set<PackageElement> includedPackageElements;
- public Set<PackageElement> getIncludedPackageElements() {
- return includedPackageElements;
- }
-
- private Set<TypeElement> includedTypeElements;
- public Set<TypeElement> getIncludedTypeElements() {
- return includedTypeElements;
- }
-
- private void initModules() {
- // Build the modules structure used by the doclet
- modules = new TreeSet<>(utils.makeModuleComparator());
- modules.addAll(getSpecifiedModuleElements());
-
- modulePackages = new TreeMap<>(utils.makeModuleComparator());
- for (PackageElement p: packages) {
- ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p);
- if (mdle != null && !mdle.isUnnamed()) {
- Set<PackageElement> s = modulePackages
- .computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator()));
- s.add(p);
- }
- }
-
- for (PackageElement p: getIncludedPackageElements()) {
- ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p);
- if (mdle != null && !mdle.isUnnamed()) {
- Set<PackageElement> s = modulePackages
- .computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator()));
- s.add(p);
- }
- }
-
- // add entries for modules which may not have exported packages
- modules.forEach((ModuleElement mdle) -> {
- modulePackages.computeIfAbsent(mdle, m -> Collections.emptySet());
- });
-
- modules.addAll(modulePackages.keySet());
- showModules = !modules.isEmpty();
- for (Set<PackageElement> pkgs : modulePackages.values()) {
- packages.addAll(pkgs);
- }
- }
-
- private void initPackages() {
- packages = new TreeSet<>(utils.makePackageComparator());
- // add all the included packages
- packages.addAll(includedPackageElements);
- }
-
- public Set<Doclet.Option> getSupportedOptions() {
- Resources resources = getResources();
- Doclet.Option[] options = {
- new Option(resources, "-author") {
- @Override
- public boolean process(String opt, List<String> args) {
- showauthor = true;
- return true;
- }
- },
- new Option(resources, "-d", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- destDirName = addTrailingFileSep(args.get(0));
- return true;
- }
- },
- new Option(resources, "-docencoding", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- docencoding = args.get(0);
- return true;
- }
- },
- new Option(resources, "-docfilessubdirs") {
- @Override
- public boolean process(String opt, List<String> args) {
- copydocfilesubdirs = true;
- return true;
- }
- },
- new Hidden(resources, "-encoding", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- encoding = args.get(0);
- return true;
- }
- },
- new Option(resources, "-excludedocfilessubdir", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- addToSet(excludedDocFileDirs, args.get(0));
- return true;
- }
- },
- new Option(resources, "-group", 2) {
- @Override
- public boolean process(String opt, List<String> args) {
- groups.add(new GroupContainer(args.get(0), args.get(1)));
- return true;
- }
- },
- new Option(resources, "--javafx -javafx") {
- @Override
- public boolean process(String opt, List<String> args) {
- javafx = true;
- return true;
- }
- },
- new Option(resources, "-keywords") {
- @Override
- public boolean process(String opt, List<String> args) {
- keywords = true;
- return true;
- }
- },
- new Option(resources, "-link", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- urlForLink = args.get(0);
- pkglistUrlForLink = urlForLink;
- return true;
- }
- },
- new Option(resources, "-linksource") {
- @Override
- public boolean process(String opt, List<String> args) {
- linksource = true;
- return true;
- }
- },
- new Option(resources, "-linkoffline", 2) {
- @Override
- public boolean process(String opt, List<String> args) {
- urlForLinkOffline = args.get(0);
- pkglistUrlForLinkOffline = args.get(1);
- return true;
- }
- },
- new Option(resources, "-nocomment") {
- @Override
- public boolean process(String opt, List<String> args) {
- nocomment = true;
- return true;
- }
- },
- new Option(resources, "-nodeprecated") {
- @Override
- public boolean process(String opt, List<String> args) {
- nodeprecated = true;
- return true;
- }
- },
- new Option(resources, "-nosince") {
- @Override
- public boolean process(String opt, List<String> args) {
- nosince = true;
- return true;
- }
- },
- new Option(resources, "-notimestamp") {
- @Override
- public boolean process(String opt, List<String> args) {
- notimestamp = true;
- return true;
- }
- },
- new Option(resources, "-noqualifier", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- addToSet(excludedQualifiers, args.get(0));
- return true;
- }
- },
- new Hidden(resources, "-quiet") {
- @Override
- public boolean process(String opt, List<String> args) {
- quiet = true;
- return true;
- }
- },
- new Option(resources, "-serialwarn") {
- @Override
- public boolean process(String opt, List<String> args) {
- serialwarn = true;
- return true;
- }
- },
- new Option(resources, "-sourcetab", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- linksource = true;
- try {
- setTabWidth(Integer.parseInt(args.get(0)));
- } catch (NumberFormatException e) {
- //Set to -1 so that warning will be printed
- //to indicate what is valid argument.
- sourcetab = -1;
- }
- if (sourcetab <= 0) {
- getMessages().warning("doclet.sourcetab_warning");
- setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH);
- }
- return true;
- }
- },
- new Option(resources, "-tag", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- ArrayList<String> list = new ArrayList<>();
- list.add(opt);
- list.add(args.get(0));
- customTagStrs.add(list);
- return true;
- }
- },
- new Option(resources, "-taglet", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- ArrayList<String> list = new ArrayList<>();
- list.add(opt);
- list.add(args.get(0));
- customTagStrs.add(list);
- return true;
- }
- },
- new Option(resources, "-tagletpath", 1) {
- @Override
- public boolean process(String opt, List<String> args) {
- tagletpath = args.get(0);
- return true;
- }
- },
- new Option(resources, "-version") {
- @Override
- public boolean process(String opt, List<String> args) {
- showversion = true;
- return true;
- }
- },
- new Hidden(resources, "--dump-on-error") {
- @Override
- public boolean process(String opt, List<String> args) {
- dumpOnError = true;
- return true;
- }
- },
- new Option(resources, "--allow-script-in-comments") {
- @Override
- public boolean process(String opt, List<String> args) {
- allowScriptInComments = true;
- return true;
- }
- }
- };
- Set<Doclet.Option> set = new TreeSet<>();
- set.addAll(Arrays.asList(options));
- return set;
- }
-
- final LinkedHashSet<List<String>> customTagStrs = new LinkedHashSet<>();
-
- /*
- * when this is called all the option have been set, this method,
- * initializes certain components before anything else is started.
- */
- private void finishOptionSettings0() throws DocletException {
- initDestDirectory();
- if (urlForLink != null && pkglistUrlForLink != null)
- extern.link(urlForLink, pkglistUrlForLink, reporter, false);
- if (urlForLinkOffline != null && pkglistUrlForLinkOffline != null)
- extern.link(urlForLinkOffline, pkglistUrlForLinkOffline, reporter, true);
- if (docencoding == null) {
- docencoding = encoding;
- }
- typeElementCatalog = new TypeElementCatalog(includedTypeElements, this);
- initTagletManager(customTagStrs);
- groups.stream().forEach((grp) -> {
- if (showModules) {
- group.checkModuleGroups(grp.value1, grp.value2);
- } else {
- group.checkPackageGroups(grp.value1, grp.value2);
- }
- });
- }
-
- /**
- * Set the command line options supported by this configuration.
- *
- * @return true if the options are set successfully
- * @throws DocletException if there is a problem while setting the options
- */
- public boolean setOptions() throws DocletException {
- initPackages();
- initModules();
- finishOptionSettings0();
- if (!finishOptionSettings())
- return false;
-
- return true;
- }
-
- private void initDestDirectory() throws DocletException {
- if (!destDirName.isEmpty()) {
- DocFile destDir = DocFile.createFileForDirectory(this, destDirName);
- if (!destDir.exists()) {
- //Create the output directory (in case it doesn't exist yet)
- reporter.print(NOTE, getText("doclet.dest_dir_create", destDirName));
- destDir.mkdirs();
- } else if (!destDir.isDirectory()) {
- throw new SimpleDocletException(getText(
- "doclet.destination_directory_not_directory_0",
- destDir.getPath()));
- } else if (!destDir.canWrite()) {
- throw new SimpleDocletException(getText(
- "doclet.destination_directory_not_writable_0",
- destDir.getPath()));
- }
- }
- DocFileFactory.getFactory(this).setDestDir(destDirName);
- }
-
- /**
- * Initialize the taglet manager. The strings to initialize the simple custom tags should
- * be in the following format: "[tag name]:[location str]:[heading]".
- *
- * @param customTagStrs the set two dimensional arrays of strings. These arrays contain
- * either -tag or -taglet arguments.
- */
- private void initTagletManager(Set<List<String>> customTagStrs) {
- tagletManager = tagletManager == null ?
- new TagletManager(nosince, showversion, showauthor, javafx, this) :
- tagletManager;
- for (List<String> args : customTagStrs) {
- if (args.get(0).equals("-taglet")) {
- tagletManager.addCustomTag(args.get(1), getFileManager(), tagletpath);
- continue;
- }
- List<String> tokens = tokenize(args.get(1), TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3);
- if (tokens.size() == 1) {
- String tagName = args.get(1);
- if (tagletManager.isKnownCustomTag(tagName)) {
- //reorder a standard tag
- tagletManager.addNewSimpleCustomTag(tagName, null, "");
- } else {
- //Create a simple tag with the heading that has the same name as the tag.
- StringBuilder heading = new StringBuilder(tagName + ":");
- heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0)));
- tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a");
- }
- } else if (tokens.size() == 2) {
- //Add simple taglet without heading, probably to excluding it in the output.
- tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(1), "");
- } else if (tokens.size() >= 3) {
- tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(2), tokens.get(1));
- } else {
- Messages messages = getMessages();
- messages.error("doclet.Error_invalid_custom_tag_argument", args.get(1));
- }
- }
- }
-
- /**
- * Given a string, return an array of tokens. The separator can be escaped
- * with the '\' character. The '\' character may also be escaped by the
- * '\' character.
- *
- * @param s the string to tokenize.
- * @param separator the separator char.
- * @param maxTokens the maximum number of tokens returned. If the
- * max is reached, the remaining part of s is appended
- * to the end of the last token.
- *
- * @return an array of tokens.
- */
- private List<String> tokenize(String s, char separator, int maxTokens) {
- List<String> tokens = new ArrayList<>();
- StringBuilder token = new StringBuilder ();
- boolean prevIsEscapeChar = false;
- for (int i = 0; i < s.length(); i += Character.charCount(i)) {
- int currentChar = s.codePointAt(i);
- if (prevIsEscapeChar) {
- // Case 1: escaped character
- token.appendCodePoint(currentChar);
- prevIsEscapeChar = false;
- } else if (currentChar == separator && tokens.size() < maxTokens-1) {
- // Case 2: separator
- tokens.add(token.toString());
- token = new StringBuilder();
- } else if (currentChar == '\\') {
- // Case 3: escape character
- prevIsEscapeChar = true;
- } else {
- // Case 4: regular character
- token.appendCodePoint(currentChar);
- }
- }
- if (token.length() > 0) {
- tokens.add(token.toString());
- }
- return tokens;
- }
-
- private void addToSet(Set<String> s, String str){
- StringTokenizer st = new StringTokenizer(str, ":");
- String current;
- while(st.hasMoreTokens()){
- current = st.nextToken();
- s.add(current);
- }
- }
-
- /**
- * Add a trailing file separator, if not found. Remove superfluous
- * file separators if any. Preserve the front double file separator for
- * UNC paths.
- *
- * @param path Path under consideration.
- * @return String Properly constructed path string.
- */
- public static String addTrailingFileSep(String path) {
- String fs = System.getProperty("file.separator");
- String dblfs = fs + fs;
- int indexDblfs;
- while ((indexDblfs = path.indexOf(dblfs, 1)) >= 0) {
- path = path.substring(0, indexDblfs) +
- path.substring(indexDblfs + fs.length());
- }
- if (!path.endsWith(fs))
- path += fs;
- return path;
- }
-
- /**
- *
- * This checks for the validity of the options used by the user.
- * As of this writing, this checks only docencoding.
- *
- * @return true if all the options are valid.
- */
- public boolean generalValidOptions() {
- if (docencoding != null) {
- if (!checkOutputFileEncoding(docencoding)) {
- return false;
- }
- }
- if (docencoding == null && (encoding != null && !encoding.isEmpty())) {
- if (!checkOutputFileEncoding(encoding)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Check the validity of the given Source or Output File encoding on this
- * platform.
- *
- * @param docencoding output file encoding.
- * @param reporter used to report errors.
- */
- private boolean checkOutputFileEncoding(String docencoding) {
- OutputStream ost= new ByteArrayOutputStream();
- OutputStreamWriter osw = null;
- try {
- osw = new OutputStreamWriter(ost, docencoding);
- } catch (UnsupportedEncodingException exc) {
- reporter.print(ERROR, getText("doclet.Encoding_not_supported", docencoding));
- return false;
- } finally {
- try {
- if (osw != null) {
- osw.close();
- }
- } catch (IOException exc) {
- }
- }
- return true;
- }
-
- /**
- * Return true if the given doc-file subdirectory should be excluded and
- * false otherwise.
- *
- * @param docfilesubdir the doc-files subdirectory to check.
- * @return true if the directory is excluded.
- */
- public boolean shouldExcludeDocFileDir(String docfilesubdir){
- return excludedDocFileDirs.contains(docfilesubdir);
- }
-
- /**
- * Return true if the given qualifier should be excluded and false otherwise.
- *
- * @param qualifier the qualifier to check.
- * @return true if the qualifier should be excluded
- */
- public boolean shouldExcludeQualifier(String qualifier){
- if (excludedQualifiers.contains("all") ||
- excludedQualifiers.contains(qualifier) ||
- excludedQualifiers.contains(qualifier + ".*")) {
- return true;
- } else {
- int index = -1;
- while ((index = qualifier.indexOf(".", index + 1)) != -1) {
- if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) {
- return true;
- }
- }
- return false;
- }
- }
-
- /**
- * Return the qualified name of the Element if its qualifier is not excluded.
- * Otherwise return the unqualified Element name.
- *
- * @param te the TypeElement to check.
- * @return the class name
- */
- public String getClassName(TypeElement te) {
- PackageElement pkg = utils.containingPackage(te);
- return shouldExcludeQualifier(utils.getPackageName(pkg))
- ? utils.getSimpleName(te)
- : utils.getFullyQualifiedName(te);
- }
-
- /**
- * Convenience method to obtain a resource from the doclet's
- * {@link Resources resources}.
- * Equivalent to <code>getResources.getText(key);</code>.
- *
- * @param key the key for the desired string
- * @return the string for the given key
- * @throws MissingResourceException if the key is not found in either
- * bundle.
- */
- public abstract String getText(String key);
-
- /**
- * Convenience method to obtain a resource from the doclet's
- * {@link Resources resources}.
- * Equivalent to <code>getResources.getText(key, args);</code>.
- *
- * @param key the key for the desired string
- * @param args values to be substituted into the resulting string
- * @return the string for the given key
- * @throws MissingResourceException if the key is not found in either
- * bundle.
- */
- public abstract String getText(String key, String... args);
-
- /**
- * Convenience method to obtain a resource from the doclet's
- * {@link Resources resources} as a {@code Content} object.
- *
- * @param key the key for the desired string
- * @return a content tree for the text
- */
- public abstract Content getContent(String key);
-
- /**
- * Convenience method to obtain a resource from the doclet's
- * {@link Resources resources} as a {@code Content} object.
- *
- * @param key the key for the desired string
- * @param o string or content argument added to configuration text
- * @return a content tree for the text
- */
- public abstract Content getContent(String key, Object o);
-
- /**
- * Convenience method to obtain a resource from the doclet's
- * {@link Resources resources} as a {@code Content} object.
- *
- * @param key the key for the desired string
- * @param o1 resource argument
- * @param o2 resource argument
- * @return a content tree for the text
- */
- public abstract Content getContent(String key, Object o1, Object o2);
-
- /**
- * Get the configuration string as a content.
- *
- * @param key the key for the desired string
- * @param o0 string or content argument added to configuration text
- * @param o1 string or content argument added to configuration text
- * @param o2 string or content argument added to configuration text
- * @return a content tree for the text
- */
- public abstract Content getContent(String key, Object o0, Object o1, Object o2);
-
- /**
- * Return true if the TypeElement element is getting documented, depending upon
- * -nodeprecated option and the deprecation information. Return true if
- * -nodeprecated is not used. Return false if -nodeprecated is used and if
- * either TypeElement element is deprecated or the containing package is deprecated.
- *
- * @param te the TypeElement for which the page generation is checked
- * @return true if it is a generated doc.
- */
- public boolean isGeneratedDoc(TypeElement te) {
- if (!nodeprecated) {
- return true;
- }
- return !(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te)));
- }
-
- /**
- * Return the doclet specific instance of a writer factory.
- *
- * @return the {@link WriterFactory} for the doclet.
- */
- public abstract WriterFactory getWriterFactory();
-
- /**
- * Return the input stream to the builder XML.
- *
- * @return the input steam to the builder XML.
- * @throws DocFileIOException when the given XML file cannot be found or opened.
- */
- public InputStream getBuilderXML() throws DocFileIOException {
- return builderXMLPath == null ?
- Configuration.class.getResourceAsStream(DEFAULT_BUILDER_XML) :
- DocFile.createFileForInput(this, builderXMLPath).openInputStream();
- }
-
- /**
- * Return the Locale for this document.
- *
- * @return the current locale
- */
- public abstract Locale getLocale();
-
- /**
- * Return the path of the overview file and null if it does not exist.
- *
- * @return the path of the overview file.
- */
- public abstract JavaFileObject getOverviewPath();
-
- /**
- * Return the current file manager.
- *
- * @return JavaFileManager
- */
- public abstract JavaFileManager getFileManager();
-
- private void setTabWidth(int n) {
- sourcetab = n;
- tabSpaces = String.format("%" + n + "s", "");
- }
-
- public abstract boolean showMessage(DocTreePath path, String key);
-
- public abstract boolean showMessage(Element e, String key);
-
- public static abstract class Option implements Doclet.Option, Comparable<Option> {
- private final String[] names;
- private final String parameters;
- private final String description;
- private final int argCount;
-
- protected Option(Resources resources, String name, int argCount) {
- this(resources, null, name, argCount);
- }
-
- protected Option(Resources resources, String keyBase, String name, int argCount) {
- this.names = name.trim().split("\\s+");
- if (keyBase == null) {
- keyBase = "doclet.usage." + names[0].toLowerCase().replaceAll("^-+", "");
- }
- String desc = getOptionsMessage(resources, keyBase + ".description");
- if (desc.isEmpty()) {
- this.description = "<MISSING KEY>";
- this.parameters = "<MISSING KEY>";
- } else {
- this.description = desc;
- this.parameters = getOptionsMessage(resources, keyBase + ".parameters");
- }
- this.argCount = argCount;
- }
-
- protected Option(Resources resources, String name) {
- this(resources, name, 0);
- }
-
- private String getOptionsMessage(Resources resources, String key) {
- try {
- return resources.getText(key);
- } catch (MissingResourceException ignore) {
- return "";
- }
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- @Override
- public Option.Kind getKind() {
- return Doclet.Option.Kind.STANDARD;
- }
-
- @Override
- public List<String> getNames() {
- return Arrays.asList(names);
- }
-
- @Override
- public String getParameters() {
- return parameters;
- }
-
- @Override
- public String toString() {
- return Arrays.toString(names);
- }
-
- @Override
- public int getArgumentCount() {
- return argCount;
- }
-
- public boolean matches(String option) {
- for (String name : names) {
- boolean matchCase = name.startsWith("--");
- if (option.startsWith("--") && option.contains("=")) {
- return name.equals(option.substring(option.indexOf("=") + 1));
- } else if (matchCase) {
- return name.equals(option);
- }
- return name.toLowerCase().equals(option.toLowerCase());
- }
- return false;
- }
-
- @Override
- public int compareTo(Option that) {
- return this.getNames().get(0).compareTo(that.getNames().get(0));
- }
- }
-
- public abstract class XOption extends Option {
-
- public XOption(Resources resources, String prefix, String name, int argCount) {
- super(resources, prefix, name, argCount);
- }
-
- public XOption(Resources resources, String name, int argCount) {
- super(resources, name, argCount);
- }
-
- public XOption(Resources resources, String name) {
- this(resources, name, 0);
- }
-
- @Override
- public Option.Kind getKind() {
- return Doclet.Option.Kind.EXTENDED;
- }
- }
-
- public abstract class Hidden extends Option {
-
- public Hidden(Resources resources, String name, int argCount) {
- super(resources, name, argCount);
- }
-
- public Hidden(Resources resources, String name) {
- this(resources, name, 0);
- }
-
- @Override
- public Option.Kind getKind() {
- return Doclet.Option.Kind.OTHER;
- }
- }
-
- /*
- * Stores a pair of Strings.
- */
- protected static class GroupContainer {
- final String value1;
- final String value2;
- public GroupContainer(String value1, String value2) {
- this.value1 = value1;
- this.value2 = value2;
- }
- }
-
- /*
- * Splits the elements in a collection to its individual
- * collection.
- */
- static private class Splitter {
-
- final Set<ModuleElement> mset = new LinkedHashSet<>();
- final Set<PackageElement> pset = new LinkedHashSet<>();
- final Set<TypeElement> tset = new LinkedHashSet<>();
-
- Splitter(DocletEnvironment docEnv, boolean included) {
-
- Set<? extends Element> inset = included
- ? docEnv.getIncludedElements()
- : docEnv.getSpecifiedElements();
-
- for (Element e : inset) {
- new SimpleElementVisitor9<Void, Void>() {
- @Override
- @DefinedBy(Api.LANGUAGE_MODEL)
- public Void visitModule(ModuleElement e, Void p) {
- mset.add(e);
- return null;
- }
-
- @Override
- @DefinedBy(Api.LANGUAGE_MODEL)
- public Void visitPackage(PackageElement e, Void p) {
- pset.add(e);
- return null;
- }
-
- @Override
- @DefinedBy(Api.LANGUAGE_MODEL)
- public Void visitType(TypeElement e, Void p) {
- tset.add(e);
- return null;
- }
-
- @Override
- @DefinedBy(Api.LANGUAGE_MODEL)
- protected Void defaultAction(Element e, Void p) {
- throw new AssertionError("unexpected element: " + e);
- }
-
- }.visit(e);
- }
- }
- }
-
- /**
- * Returns whether or not to allow JavaScript in comments.
- * Default is off; can be set true from a command line option.
- * @return the allowScriptInComments
- */
- public boolean isAllowScriptInComments() {
- return allowScriptInComments;
- }
-
- public VisibleMemberMap getVisibleMemberMap(TypeElement te, VisibleMemberMap.Kind kind) {
- EnumMap<Kind, Reference<VisibleMemberMap>> cacheMap = typeElementMemberCache
- .computeIfAbsent(te, k -> new EnumMap<>(VisibleMemberMap.Kind.class));
-
- Reference<VisibleMemberMap> vmapRef = cacheMap.get(kind);
- // recompute, if referent has been garbage collected
- VisibleMemberMap vMap = vmapRef == null ? null : vmapRef.get();
- if (vMap == null) {
- vMap = new VisibleMemberMap(te, kind, this);
- cacheMap.put(kind, new SoftReference<>(vMap));
- }
- return vMap;
- }
-}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
* Messages are reported to the doclet's {@link Reporter reporter}.
*/
public class Messages {
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final Resources resources;
private Reporter reporter;
@@ -55,7 +55,7 @@
* the doclet's resources, reporter, and additional methods and state
* used to filter out messages, if any, which should be suppressed.
*/
- public Messages(Configuration configuration) {
+ public Messages(BaseConfiguration configuration) {
this.configuration = configuration;
resources = configuration.getResources();
}
@@ -155,7 +155,7 @@
}
// Lazy init the reporter for now, until we can fix/improve
- // the init of ConfigurationImpl in HtmlDoclet (and similar.)
+ // the init of HtmlConfiguration in HtmlDoclet (and similar.)
private void initReporter() {
if (reporter == null) {
reporter = configuration.reporter;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
* HTML doclet.
*/
public class Resources {
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final String commonBundleName;
private final String docletBundleName;
@@ -58,7 +58,7 @@
* @param docletBundleName the name of the bundle containing the strings
* specific to a particular format
*/
- public Resources(Configuration configuration, String commonBundleName, String docletBundleName) {
+ public Resources(BaseConfiguration configuration, String commonBundleName, String docletBundleName) {
this.configuration = configuration;
this.commonBundleName = commonBundleName;
this.docletBundleName = docletBundleName;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java Mon Jun 05 13:45:34 2017 -0700
@@ -89,13 +89,13 @@
*/
public class WorkArounds {
- public final Configuration configuration;
+ public final BaseConfiguration configuration;
public final ToolEnvironment toolEnv;
public final Utils utils;
private DocLint doclint;
- public WorkArounds(Configuration configuration) {
+ public WorkArounds(BaseConfiguration configuration) {
this.configuration = configuration;
this.utils = this.configuration.utils;
this.toolEnv = ((DocEnvImpl)this.configuration.docEnv).toolEnv;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.Messages;
@@ -65,7 +65,7 @@
/**
* The configuration used in this run of the doclet.
*/
- final Configuration configuration;
+ final BaseConfiguration configuration;
/**
* Keep track of which packages we have seen for
@@ -79,7 +79,7 @@
*/
final LayoutParser layoutParser;
- Context(Configuration configuration,
+ Context(BaseConfiguration configuration,
Set<PackageElement> containingPackagesSeen,
LayoutParser layoutParser) {
this.configuration = configuration;
@@ -91,7 +91,7 @@
/**
* The configuration used in this run of the doclet.
*/
- protected final Configuration configuration;
+ protected final BaseConfiguration configuration;
protected final Messages messages;
protected final Resources resources;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
import javax.lang.model.element.Element;
-import jdk.javadoc.internal.doclets.formats.html.ConfigurationImpl;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -31,7 +31,7 @@
import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
@@ -193,7 +193,7 @@
/**
* Build the comments for the member. Do nothing if
- * {@link Configuration#nocomment} is set to true.
+ * {@link BaseConfiguration#nocomment} is set to true.
*
* @param node the XML element that specifies which components to document
* @param annotationDocTree the content tree to which the documentation will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -31,7 +31,7 @@
import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
@@ -192,7 +192,7 @@
/**
* Build the comments for the member. Do nothing if
- * {@link Configuration#nocomment} is set to true.
+ * {@link BaseConfiguration#nocomment} is set to true.
*
* @param node the XML element that specifies which components to document
* @param annotationDocTree the content tree to which the documentation will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
@@ -56,7 +56,7 @@
/**
* The current configuration of the doclet.
*/
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
/**
* The factory to retrieve the required writers from.
@@ -70,7 +70,7 @@
* @param configuration the configuration for the current doclet
* being executed.
*/
- public BuilderFactory (Configuration configuration) {
+ public BuilderFactory (BaseConfiguration configuration) {
this.configuration = configuration;
this.writerFactory = configuration.getWriterFactory();
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -31,7 +31,7 @@
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.ConstructorWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
@@ -192,7 +192,7 @@
/**
* Build the comments for the constructor. Do nothing if
- * {@link Configuration#nocomment} is set to true.
+ * {@link BaseConfiguration#nocomment} is set to true.
*
* @param node the XML element that specifies which components to document
* @param constructorDocTree the content tree to which the documentation will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -31,7 +31,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.EnumConstantWriter;
@@ -175,7 +175,7 @@
/**
* Build the comments for the enum constant. Do nothing if
- * {@link Configuration#nocomment} is set to true.
+ * {@link BaseConfiguration#nocomment} is set to true.
*
* @param node the XML element that specifies which components to document
* @param enumConstantsTree the content tree to which the documentation will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -31,7 +31,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.FieldWriter;
@@ -176,7 +176,7 @@
/**
* Build the comments for the field. Do nothing if
- * {@link Configuration#nocomment} is set to true.
+ * {@link BaseConfiguration#nocomment} is set to true.
*
* @param node the XML element that specifies which components to document
* @param fieldDocTree the content tree to which the documentation will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
import javax.xml.parsers.*;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException;
import org.xml.sax.*;
@@ -56,11 +56,11 @@
*/
private final Map<String,XMLNode> xmlElementsMap;
private XMLNode currentNode;
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private String currentRoot;
private boolean isParsing;
- private LayoutParser(Configuration configuration) {
+ private LayoutParser(BaseConfiguration configuration) {
xmlElementsMap = new HashMap<>();
this.configuration = configuration;
}
@@ -71,7 +71,7 @@
* @param configuration the current configuration of the doclet.
* @return an instance of the BuilderXML.
*/
- public static LayoutParser getInstance(Configuration configuration) {
+ public static LayoutParser getInstance(BaseConfiguration configuration) {
return new LayoutParser(configuration);
}
@@ -95,7 +95,7 @@
} catch (IOException | ParserConfigurationException | SAXException e) {
String message = (configuration.builderXMLPath == null)
? configuration.getResources().getText("doclet.exception.read.resource",
- Configuration.DEFAULT_BUILDER_XML, e)
+ BaseConfiguration.DEFAULT_BUILDER_XML, e)
: configuration.getResources().getText("doclet.exception.read.file",
configuration.builderXMLPath, e);
throw new SimpleDocletException(message, e);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -32,8 +32,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
-import jdk.javadoc.internal.doclets.formats.html.ConfigurationImpl;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.MethodWriter;
@@ -178,7 +177,7 @@
/**
* Build the comments for the method. Do nothing if
- * {@link Configuration#nocomment} is set to true.
+ * {@link BaseConfiguration#nocomment} is set to true.
*
* @param node the XML element that specifies which components to document
* @param methodDocTree the content tree to which the documentation will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -31,7 +31,7 @@
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
@@ -177,7 +177,7 @@
/**
* Build the comments for the property. Do nothing if
- * {@link Configuration#nocomment} is set to true.
+ * {@link BaseConfiguration#nocomment} is set to true.
*
* @param node the XML element that specifies which components to document
* @param propertyDocTree the content tree to which the documentation will be added
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/InheritDocTaglet.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/InheritDocTaglet.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
import javax.lang.model.element.ExecutableElement;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
@@ -135,7 +135,7 @@
private Content retrieveInheritedDocumentation(TagletWriter writer,
Element e, DocTree holderTag, boolean isFirstSentence) {
Content replacement = writer.getOutputInstance();
- Configuration configuration = writer.configuration();
+ BaseConfiguration configuration = writer.configuration();
Messages messages = configuration.getMessages();
Utils utils = configuration.utils;
CommentHelper ch = utils.getCommentHelper(e);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java Mon Jun 05 13:45:34 2017 -0700
@@ -42,7 +42,7 @@
import com.sun.source.doctree.DocTree;
import jdk.javadoc.doclet.Doclet;
import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.Resources;
@@ -194,7 +194,7 @@
*/
public TagletManager(boolean nosince, boolean showversion,
boolean showauthor, boolean javafx,
- Configuration configuration) {
+ BaseConfiguration configuration) {
overridenStandardTags = new HashSet<>();
potentiallyConflictingTags = new HashSet<>();
standardTags = new HashSet<>();
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.taglets.Taglet.UnsupportedTagletOperationException;
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
@@ -326,5 +326,5 @@
/**
* @return an instance of the configuration used for this doclet.
*/
- public abstract Configuration configuration();
+ public abstract BaseConfiguration configuration();
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
import javax.lang.model.util.Elements;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
@@ -133,7 +133,7 @@
* return field that the value tag was used in. Return null if the name is null
* or empty string and if the value tag is not used on a field.
*/
- private VariableElement getVariableElement(Element holder, Configuration config, DocTree tag) {
+ private VariableElement getVariableElement(Element holder, BaseConfiguration config, DocTree tag) {
Utils utils = config.utils;
CommentHelper ch = utils.getCommentHelper(holder);
String signature = ch.getReferencedSignature(tag);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ClassTree.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ClassTree.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
import javax.lang.model.type.TypeMirror;
import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Messages;
/**
@@ -94,7 +94,7 @@
*/
private final Map<TypeElement, SortedSet<TypeElement>> implementingClasses = new HashMap<>();
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final Utils utils;
private final Comparator<Element> comparator;
@@ -105,7 +105,7 @@
* @param noDeprecated Don't add deprecated classes in the class tree, if
* true.
*/
- public ClassTree(Configuration configuration, boolean noDeprecated) {
+ public ClassTree(BaseConfiguration configuration, boolean noDeprecated) {
this.configuration = configuration;
this.utils = configuration.utils;
@@ -126,7 +126,7 @@
* @param docEnv the DocletEnvironment.
* @param configuration The current configuration of the doclet.
*/
- public ClassTree(DocletEnvironment docEnv, Configuration configuration) {
+ public ClassTree(DocletEnvironment docEnv, BaseConfiguration configuration) {
this.configuration = configuration;
this.utils = configuration.utils;
comparator = utils.makeClassUseComparator();
@@ -143,7 +143,7 @@
* @param classesSet a set of classes
* @param configuration The current configuration of the doclet.
*/
- public ClassTree(SortedSet<TypeElement>classesSet, Configuration configuration) {
+ public ClassTree(SortedSet<TypeElement>classesSet, BaseConfiguration configuration) {
this.configuration = configuration;
this.utils = configuration.utils;
comparator = utils.makeClassUseComparator();
@@ -203,7 +203,7 @@
* @param typeElement for which sub class mapping is to be generated.
* @param configuration the current configuration of the doclet.
*/
- private void processType(TypeElement typeElement, Configuration configuration,
+ private void processType(TypeElement typeElement, BaseConfiguration configuration,
Collection<TypeElement> bases, Map<TypeElement, SortedSet<TypeElement>> subs) {
TypeElement superclass = utils.getFirstVisibleSuperClassAsTypeElement(typeElement);
if (superclass != null) {
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ClassUseMapper.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ClassUseMapper.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
import javax.lang.model.util.Types;
import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.internal.doclets.formats.html.ConfigurationImpl;
+import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
/**
* Map all class uses for a given class.
@@ -190,7 +190,7 @@
private final Types typeUtils;
private final Utils utils;
- public ClassUseMapper(ConfigurationImpl configuration, ClassTree classtree) {
+ public ClassUseMapper(HtmlConfiguration configuration, ClassTree classtree) {
docEnv = configuration.docEnv;
elementUtils = docEnv.getElementUtils();
typeUtils = docEnv.getTypeUtils();
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/CommentHelper.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/CommentHelper.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@
import com.sun.source.util.DocTrees;
import com.sun.source.util.SimpleDocTreeVisitor;
import com.sun.source.util.TreePath;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import static com.sun.source.doctree.DocTree.Kind.*;
@@ -89,7 +89,7 @@
public static final String SPACER = " ";
- public CommentHelper(Configuration configuration, Element element, TreePath path, DocCommentTree dctree) {
+ public CommentHelper(BaseConfiguration configuration, Element element, TreePath path, DocCommentTree dctree) {
//this.configuration = configuration;
this.element = element;
this.path = path;
@@ -143,7 +143,7 @@
}
}
- Element getElement(Configuration c, ReferenceTree rtree) {
+ Element getElement(BaseConfiguration c, ReferenceTree rtree) {
// likely a synthesized tree
if (path == null) {
TypeMirror symbol = c.utils.getSymbol(rtree.getSignature());
@@ -178,7 +178,7 @@
return doctrees.getElement(docTreePath);
}
- public Element getException(Configuration c, DocTree dtree) {
+ public Element getException(BaseConfiguration c, DocTree dtree) {
if (dtree.getKind() == THROWS || dtree.getKind() == EXCEPTION) {
ThrowsTree tt = (ThrowsTree)dtree;
ReferenceTree exceptionName = tt.getExceptionName();
@@ -187,7 +187,7 @@
return null;
}
- public List<? extends DocTree> getDescription(Configuration c, DocTree dtree) {
+ public List<? extends DocTree> getDescription(BaseConfiguration c, DocTree dtree) {
return getTags(c, dtree);
}
@@ -334,7 +334,7 @@
return sb;
}
- public String getLabel(Configuration c, DocTree dtree) {
+ public String getLabel(BaseConfiguration c, DocTree dtree) {
return new SimpleDocTreeVisitor<String, Void>() {
@Override
public String visitLink(LinkTree node, Void p) {
@@ -361,7 +361,7 @@
}.visit(dtree, null);
}
- public TypeElement getReferencedClass(Configuration c, DocTree dtree) {
+ public TypeElement getReferencedClass(BaseConfiguration c, DocTree dtree) {
Element e = getReferencedElement(c, dtree);
if (e == null) {
return null;
@@ -373,7 +373,7 @@
return null;
}
- public String getReferencedClassName(Configuration c, DocTree dtree) {
+ public String getReferencedClassName(BaseConfiguration c, DocTree dtree) {
Element e = getReferencedClass(c, dtree);
if (e != null) {
return c.utils.isTypeElement(e) ? c.utils.getSimpleName(e) : null;
@@ -386,7 +386,7 @@
return (n == -1) ? s : s.substring(0, n);
}
- public Element getReferencedMember(Configuration c, DocTree dtree) {
+ public Element getReferencedMember(BaseConfiguration c, DocTree dtree) {
Element e = getReferencedElement(c, dtree);
if (e == null) {
return null;
@@ -403,7 +403,7 @@
return (n == -1) ? null : s.substring(n + 1);
}
- public String getReferencedMemberName(Configuration c, Element e) {
+ public String getReferencedMemberName(BaseConfiguration c, Element e) {
if (e == null) {
return null;
}
@@ -412,7 +412,7 @@
: c.utils.getSimpleName(e);
}
- public PackageElement getReferencedPackage(Configuration c, DocTree dtree) {
+ public PackageElement getReferencedPackage(BaseConfiguration c, DocTree dtree) {
Element e = getReferencedElement(c, dtree);
if (e != null) {
return c.utils.containingPackage(e);
@@ -420,16 +420,16 @@
return null;
}
- public List<? extends DocTree> getFirstSentenceTrees(Configuration c, List<? extends DocTree> body) {
+ public List<? extends DocTree> getFirstSentenceTrees(BaseConfiguration c, List<? extends DocTree> body) {
List<DocTree> firstSentence = c.docEnv.getDocTrees().getFirstSentence(body);
return firstSentence;
}
- public List<? extends DocTree> getFirstSentenceTrees(Configuration c, DocTree dtree) {
+ public List<? extends DocTree> getFirstSentenceTrees(BaseConfiguration c, DocTree dtree) {
return getFirstSentenceTrees(c, getBody(c, dtree));
}
- private Element getReferencedElement(Configuration c, DocTree dtree) {
+ private Element getReferencedElement(BaseConfiguration c, DocTree dtree) {
return new SimpleDocTreeVisitor<Element, Void>() {
@Override
public Element visitSee(SeeTree node, Void p) {
@@ -476,7 +476,7 @@
}.visit(dtree, null);
}
- public TypeElement getServiceType(Configuration c, DocTree dtree) {
+ public TypeElement getServiceType(BaseConfiguration c, DocTree dtree) {
Element e = getReferencedElement(c, dtree);
if (e != null) {
return c.utils.isTypeElement(e) ? (TypeElement) e : null;
@@ -542,7 +542,7 @@
}
}
- public List<? extends DocTree> getTags(Configuration c, DocTree dtree) {
+ public List<? extends DocTree> getTags(BaseConfiguration c, DocTree dtree) {
return new SimpleDocTreeVisitor<List<? extends DocTree>, Void>() {
List<? extends DocTree> asList(String content) {
List<DocTree> out = new ArrayList<>();
@@ -647,7 +647,7 @@
}.visit(dtree, null);
}
- public List<? extends DocTree> getBody(Configuration c, DocTree dtree) {
+ public List<? extends DocTree> getBody(BaseConfiguration c, DocTree dtree) {
return getTags(c, dtree);
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DeprecatedAPIListBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DeprecatedAPIListBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
* Build list of all the deprecated packages, classes, constructors, fields and methods.
@@ -49,7 +49,7 @@
* List of deprecated type Lists.
*/
private final Map<DeprElementKind, SortedSet<Element>> deprecatedMap;
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final Utils utils;
public static enum DeprElementKind {
REMOVAL,
@@ -72,7 +72,7 @@
*
* @param configuration the current configuration of the doclet
*/
- public DeprecatedAPIListBuilder(Configuration configuration) {
+ public DeprecatedAPIListBuilder(BaseConfiguration configuration) {
this.configuration = configuration;
this.utils = configuration.utils;
deprecatedMap = new EnumMap<>(DeprElementKind.class);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
import javax.tools.JavaFileManager.Location;
import javax.tools.StandardLocation;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
* Abstraction for handling files, which may be specified directly
@@ -51,17 +51,17 @@
public abstract class DocFile {
/** Create a DocFile for a directory. */
- public static DocFile createFileForDirectory(Configuration configuration, String file) {
+ public static DocFile createFileForDirectory(BaseConfiguration configuration, String file) {
return DocFileFactory.getFactory(configuration).createFileForDirectory(file);
}
/** Create a DocFile for a file that will be opened for reading. */
- public static DocFile createFileForInput(Configuration configuration, String file) {
+ public static DocFile createFileForInput(BaseConfiguration configuration, String file) {
return DocFileFactory.getFactory(configuration).createFileForInput(file);
}
/** Create a DocFile for a file that will be opened for writing. */
- public static DocFile createFileForOutput(Configuration configuration, DocPath path) {
+ public static DocFile createFileForOutput(BaseConfiguration configuration, DocPath path) {
return DocFileFactory.getFactory(configuration).createFileForOutput(path);
}
@@ -85,7 +85,7 @@
* @param path the subdirectory of the directories of the location for which to
* list files
*/
- public static Iterable<DocFile> list(Configuration configuration, Location location, DocPath path) {
+ public static Iterable<DocFile> list(BaseConfiguration configuration, Location location, DocPath path) {
return DocFileFactory.getFactory(configuration).list(location, path);
}
@@ -173,7 +173,7 @@
return;
try {
- InputStream in = Configuration.class.getResourceAsStream(resource.getPath());
+ InputStream in = BaseConfiguration.class.getResourceAsStream(resource.getPath());
if (in == null)
return;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFileFactory.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFileFactory.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
/**
@@ -50,7 +50,7 @@
* @param configuration the configuration for this doclet
* @return the factory associated with this configuration
*/
- public static synchronized DocFileFactory getFactory(Configuration configuration) {
+ public static synchronized DocFileFactory getFactory(BaseConfiguration configuration) {
DocFileFactory f = configuration.docFileFactory;
if (f == null) {
JavaFileManager fm = configuration.getFileManager();
@@ -64,9 +64,9 @@
return f;
}
- protected Configuration configuration;
+ protected BaseConfiguration configuration;
- protected DocFileFactory(Configuration configuration) {
+ protected DocFileFactory(BaseConfiguration configuration) {
this.configuration = configuration;
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFinder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFinder.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.taglets.InheritableTaglet;
/**
@@ -241,7 +241,7 @@
*
* @return an Output object representing the documentation that was found.
*/
- public static Output search(Configuration configuration, Input input) {
+ public static Output search(BaseConfiguration configuration, Input input) {
Output output = new Output();
Utils utils = configuration.utils;
if (input.isInheritDocTag) {
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
import javax.tools.DocumentationTool;
import jdk.javadoc.doclet.Reporter;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
* Process and manage "-link" and "-linkoffline" to external packages. The
@@ -64,7 +64,7 @@
/**
* The global configuration information for this run.
*/
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
/**
* True if we are using -linkoffline and false if -link is used instead.
@@ -123,7 +123,7 @@
}
}
- public Extern(Configuration configuration) {
+ public Extern(BaseConfiguration configuration) {
this.configuration = configuration;
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Group.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Group.java Mon Jun 05 13:45:34 2017 -0700
@@ -30,7 +30,7 @@
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Messages;
@@ -87,7 +87,7 @@
/**
* The global configuration information for this run.
*/
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private Messages messages;
/**
@@ -101,7 +101,7 @@
}
}
- public Group(Configuration configuration) {
+ public Group(BaseConfiguration configuration) {
this.configuration = configuration;
messages = configuration.getMessages();
}
@@ -199,7 +199,7 @@
}
// Lazy init of the messages for now, because Group is created
- // in Configuration before configuration is fully initialized.
+ // in BaseConfiguration before configuration is fully initialized.
private void initMessages() {
if (messages == null) {
messages = configuration.getMessages();
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ImplementedMethods.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/ImplementedMethods.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
* For a given class method, build an array of interface methods which it
@@ -52,7 +52,7 @@
private final TypeElement typeElement;
private final ExecutableElement method;
- public ImplementedMethods(ExecutableElement method, Configuration configuration) {
+ public ImplementedMethods(ExecutableElement method, BaseConfiguration configuration) {
this.method = method;
this.utils = configuration.utils;
typeElement = utils.getEnclosingTypeElement(method);
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexBuilder.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
import javax.lang.model.element.TypeElement;
import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Messages;
/**
@@ -73,7 +73,7 @@
*/
private boolean javafx;
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final Utils utils;
private final Comparator<Element> comparator;
@@ -84,7 +84,7 @@
* @param noDeprecated true if -nodeprecated option is used,
* false otherwise.
*/
- public IndexBuilder(Configuration configuration, boolean noDeprecated) {
+ public IndexBuilder(BaseConfiguration configuration, boolean noDeprecated) {
this(configuration, noDeprecated, false);
}
@@ -96,7 +96,7 @@
* false otherwise.
* @param classesOnly Include only classes in index.
*/
- public IndexBuilder(Configuration configuration, boolean noDeprecated,
+ public IndexBuilder(BaseConfiguration configuration, boolean noDeprecated,
boolean classesOnly) {
this.configuration = configuration;
this.utils = configuration.utils;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/MetaKeywords.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/MetaKeywords.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
* Provides methods for creating an array of class, method and
@@ -52,12 +52,12 @@
/**
* The global configuration information for this run.
*/
- private final Configuration config;
+ private final BaseConfiguration config;
/**
* Constructor
*/
- public MetaKeywords(Configuration configuration) {
+ public MetaKeywords(BaseConfiguration configuration) {
config = configuration;
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/PackageListWriter.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/PackageListWriter.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
import javax.lang.model.element.PackageElement;
import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
@@ -45,7 +45,7 @@
*/
public class PackageListWriter {
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final Utils utils;
private final DocFile file;
@@ -54,7 +54,7 @@
*
* @param configuration the current configuration of the doclet.
*/
- public PackageListWriter(Configuration configuration) {
+ public PackageListWriter(BaseConfiguration configuration) {
file = DocFile.createFileForOutput(configuration, DocPaths.PACKAGE_LIST);
this.configuration = configuration;
this.utils = configuration.utils;
@@ -66,7 +66,7 @@
* @param configuration the current configuration of the doclet.
* @throws DocFileIOException if there is a problem writing the output
*/
- public static void generate(Configuration configuration) throws DocFileIOException {
+ public static void generate(BaseConfiguration configuration) throws DocFileIOException {
PackageListWriter packgen = new PackageListWriter(configuration);
packgen.generatePackageListFile(configuration.docEnv);
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
import javax.tools.StandardLocation;
import com.sun.tools.javac.util.Assert;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
* Implementation of DocFileFactory using a {@link StandardJavaFileManager}.
@@ -68,7 +68,7 @@
private final StandardJavaFileManager fileManager;
private Path destDir;
- public StandardDocFileFactory(Configuration configuration) {
+ public StandardDocFileFactory(BaseConfiguration configuration) {
super(configuration);
fileManager = (StandardJavaFileManager) configuration.getFileManager();
}
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
/**
* This class acts as an artificial container for classes specified on the command line when
@@ -88,7 +88,7 @@
*/
private final Map<PackageElement, SortedSet<TypeElement>> interfaces;
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final Utils utils;
private final Comparator<Element> comparator;
@@ -97,7 +97,7 @@
*
* @param typeElements the array of TypeElements to catalog
*/
- public TypeElementCatalog(Iterable<TypeElement> typeElements, Configuration config) {
+ public TypeElementCatalog(Iterable<TypeElement> typeElements, BaseConfiguration config) {
this(config);
for (TypeElement typeElement : typeElements) {
addTypeElement(typeElement);
@@ -108,7 +108,7 @@
* Construct a new TypeElementCatalog.
*
*/
- public TypeElementCatalog(Configuration config) {
+ public TypeElementCatalog(BaseConfiguration config) {
this.configuration = config;
this.utils = config.utils;
comparator = utils.makeGeneralPurposeComparator();
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Mon Jun 05 13:45:34 2017 -0700
@@ -78,8 +78,8 @@
import com.sun.source.util.DocTrees;
import com.sun.source.util.TreePath;
import com.sun.tools.javac.model.JavacTypes;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.CommentUtils.DocCommentDuo;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.WorkArounds;
import jdk.javadoc.internal.tool.DocEnvImpl;
@@ -104,14 +104,14 @@
* @author Jamie Ho
*/
public class Utils {
- public final Configuration configuration;
+ public final BaseConfiguration configuration;
public final Messages messages;
public final DocTrees docTrees;
public final Elements elementUtils;
public final Types typeUtils;
public final JavaScriptScanner javaScriptScanner;
- public Utils(Configuration c) {
+ public Utils(BaseConfiguration c) {
configuration = c;
messages = configuration.getMessages();
elementUtils = c.docEnv.getElementUtils();
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberMap.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberMap.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
import com.sun.source.doctree.DocCommentTree;
import com.sun.source.doctree.DocTree;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Messages;
/**
@@ -126,7 +126,7 @@
/**
* The configuration this VisibleMemberMap was created with.
*/
- private final Configuration configuration;
+ private final BaseConfiguration configuration;
private final Messages messages;
private final Utils utils;
private final Comparator<Element> comparator;
@@ -147,7 +147,7 @@
*/
public VisibleMemberMap(TypeElement typeElement,
Kind kind,
- Configuration configuration) {
+ BaseConfiguration configuration) {
this.typeElement = typeElement;
this.kind = kind;
this.configuration = configuration;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkInfo.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkInfo.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
/**
@@ -140,7 +140,7 @@
* @param configuration the current configuration of the doclet.
* @return the label for this class link.
*/
- public Content getClassLinkLabel(Configuration configuration) {
+ public Content getClassLinkLabel(BaseConfiguration configuration) {
if (label != null && !label.isEmpty()) {
return label;
} else if (isLinkable()) {
--- a/langtools/test/jdk/javadoc/tool/T4696488.java Sat Jun 03 02:45:43 2017 +0000
+++ b/langtools/test/jdk/javadoc/tool/T4696488.java Mon Jun 05 13:45:34 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
* @run main T4696488 T4696488.java
*/
-import jdk.javadoc.internal.doclets.toolkit.Configuration;
+import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
public class T4696488 {
@@ -49,7 +49,7 @@
}
private static void assertAddTrailingFileSep(String input, String expectedOutput) {
- String output = Configuration.addTrailingFileSep(input);
+ String output = BaseConfiguration.addTrailingFileSep(input);
if (!expectedOutput.equals(output)) {
throw new Error("expected " + expectedOutput + " but was " + output);
}