langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java
author bpatel
Fri, 19 Aug 2016 12:54:02 -0700
changeset 40511 1b3c502e0bdc
parent 40508 74ef30d16fb9
child 40587 1c355ea550ed
permissions -rw-r--r--
8155995: Update javadoc to include module search Reviewed-by: jjg, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
     2
 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2212
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 13842
diff changeset
    28
import java.net.*;
8d2148961366 8000663: clean up langtools imports
jjg
parents: 13842
diff changeset
    29
import java.util.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    31
import javax.lang.model.element.Element;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    32
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    33
import javax.lang.model.element.TypeElement;
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
    34
import javax.tools.JavaFileManager;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    35
import javax.tools.JavaFileObject;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    36
import javax.tools.StandardJavaFileManager;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    37
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    38
import com.sun.source.util.DocTreePath;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    39
import com.sun.tools.doclint.DocLint;
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
    40
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    41
import jdk.javadoc.doclet.Doclet;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    42
import jdk.javadoc.doclet.DocletEnvironment;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    43
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    44
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlVersion;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    45
import jdk.javadoc.internal.doclets.toolkit.Configuration;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    46
import jdk.javadoc.internal.doclets.toolkit.Content;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
    47
import jdk.javadoc.internal.doclets.toolkit.Messages;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
    48
import jdk.javadoc.internal.doclets.toolkit.Resources;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    49
import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    50
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    51
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    52
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    53
import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    54
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    55
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    56
import static javax.tools.Diagnostic.Kind.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 * Configure the output based on the command line options.
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
 * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
 * Also determine the length of the command line option. For example,
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
 * for a option "-header" there will be a string argument associated, then the
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
 * the length of option "-header" is two. But for option "-nohelp" no argument
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
 * is needed so it's length is 1.
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
 * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
 * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
 * Also do the error checking on the options used. For example it is illegal to
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
 * use "-helpfile" option when already "-nohelp" option is used.
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
 * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
 *
14368
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
    71
 *  <p><b>This is NOT part of any supported API.
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
    72
 *  If you write code that depends on this, you do so at your own risk.
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
    73
 *  This code and its internal interfaces are subject to change or
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
    74
 *  deletion without notice.</b>
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
    75
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
 * @author Robert Field.
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
 * @author Atul Dambalkar.
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
 * @author Jamie Ho
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
    79
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
public class ConfigurationImpl extends Configuration {
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     * The build date.  Note: For now, we will use
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     * a version number instead of a date.
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    public static final String BUILD_DATE = System.getProperty("java.version");
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     * Argument for command line option "-header".
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    public String header = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * Argument for command line option "-packagesheader".
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    public String packagesheader = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     * Argument for command line option "-footer".
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    public String footer = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
     * Argument for command line option "-doctitle".
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    public String doctitle = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     * Argument for command line option "-windowtitle".
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
    public String windowtitle = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
     * Argument for command line option "-top".
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
    public String top = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
     * Argument for command line option "-bottom".
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
    public String bottom = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     * Argument for command line option "-helpfile".
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
    public String helpfile = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
     * Argument for command line option "-stylesheetfile".
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
    public String stylesheetfile = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
    /**
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   135
     * Argument for command line option "-Xdocrootparent".
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   136
     */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   137
    public String docrootparent = "";
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   138
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   139
    public boolean sortedMethodDetails = false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   140
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   141
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     * True if command line option "-nohelp" is used. Default value is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    public boolean nohelp = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
     * True if command line option "-splitindex" is used. Default value is
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     * false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
    public boolean splitindex = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
     * False if command line option "-noindex" is used. Default value is true.
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    public boolean createindex = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     * True if command line option "-use" is used. Default value is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    public boolean classuse = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
     * False if command line option "-notree" is used. Default value is true.
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
    public boolean createtree = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
     * True if command line option "-nodeprecated" is used. Default value is
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
     * false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    public boolean nodeprecatedlist = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * True if command line option "-nonavbar" is used. Default value is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    public boolean nonavbar = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
     * True if command line option "-nooverview" is used. Default value is
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
     * false
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
    private boolean nooverview = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
    /**
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   185
     * The overview path specified with "-overview" flag.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   187
    public String overviewpath = null;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
     * This is true if option "-overview" is used or option "-overview" is not
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
     * used and number of packages is more than one.
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    public boolean createoverview = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
    /**
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   196
     * Specifies whether or not frames should be generated.
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   197
     * Defaults to true; can be set by --frames; can be set to false by --no-frames; last one wins.
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   198
     */
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   199
    public boolean frames = true;
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   200
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   201
    /**
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   202
     * This is the HTML version of the generated pages. HTML 4.01 is the default output version.
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   203
     */
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   204
    public HtmlVersion htmlVersion = HtmlVersion.HTML4;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   205
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   206
    /**
15354
52a04c670c05 8004834: Add doclint support into javadoc
jjg
parents: 14545
diff changeset
   207
     * Collected set of doclint options
52a04c670c05 8004834: Add doclint support into javadoc
jjg
parents: 14545
diff changeset
   208
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   209
    public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>();
15354
52a04c670c05 8004834: Add doclint support into javadoc
jjg
parents: 14545
diff changeset
   210
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   211
    public final Resources resources;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     * First file to appear in the right-hand frame in the generated
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
     * documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
     */
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14259
diff changeset
   217
    public DocPath topFile = DocPath.empty;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
    /**
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   220
     * The TypeElement for the class file getting generated.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   222
    public TypeElement currentTypeElement = null;  // Set this TypeElement in the ClassWriter.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   224
    protected List<SearchIndexItem> memberSearchIndex = new ArrayList<>();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   225
40511
1b3c502e0bdc 8155995: Update javadoc to include module search
bpatel
parents: 40508
diff changeset
   226
    protected List<SearchIndexItem> moduleSearchIndex = new ArrayList<>();
1b3c502e0bdc 8155995: Update javadoc to include module search
bpatel
parents: 40508
diff changeset
   227
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   228
    protected List<SearchIndexItem> packageSearchIndex = new ArrayList<>();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   229
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   230
    protected List<SearchIndexItem> tagSearchIndex = new ArrayList<>();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   231
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   232
    protected List<SearchIndexItem> typeSearchIndex = new ArrayList<>();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   233
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   234
    protected Map<Character,List<SearchIndexItem>> tagSearchIndexMap = new HashMap<>();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   235
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   236
    protected Set<Character> tagSearchIndexKeys;
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   237
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   238
    protected Contents contents;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   239
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   240
    protected Messages messages;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   241
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
    /**
14259
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 14258
diff changeset
   243
     * Constructor. Initializes resource for the
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 14258
diff changeset
   244
     * {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
   246
    public ConfigurationImpl() {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   247
        resources = new Resources(this,
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   248
                Configuration.sharedResourceBundleName,
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   249
                "jdk.javadoc.internal.doclets.formats.html.resources.standard");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   250
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   251
        messages = new Messages(this);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   252
        contents = new Contents(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   255
    private final String versionRBName = "jdk.javadoc.internal.tool.resources.version";
21888
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   256
    private ResourceBundle versionRB;
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   257
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   258
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
     * Return the build date for the doclet.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   260
     * @return the build date
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
     */
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   262
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
    public String getDocletSpecificBuildDate() {
21888
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   264
        if (versionRB == null) {
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   265
            try {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   266
                versionRB = ResourceBundle.getBundle(versionRBName, getLocale());
21888
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   267
            } catch (MissingResourceException e) {
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   268
                return BUILD_DATE;
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   269
            }
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   270
        }
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   271
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   272
        try {
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   273
            return versionRB.getString("release");
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   274
        } catch (MissingResourceException e) {
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   275
            return BUILD_DATE;
568c5da9f16b 6726154: javadoc generated with incorrect version in comment
kizune
parents: 21500
diff changeset
   276
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   279
    @Override
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   280
    public Resources getResources() {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   281
        return resources;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   282
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   283
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   284
    @Override
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   285
    public Messages getMessages() {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   286
        return messages;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   287
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   288
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   289
    protected boolean validateOptions() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   290
        // check shared options
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   291
        if (!generalValidOptions()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   292
            return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   293
        }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   294
        boolean helpfileSeen = false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   295
        // otherwise look at our options
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   296
        for (Doclet.Option opt : optionsProcessed) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   297
            if (opt.matches("-helpfile")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   298
                if (nohelp == true) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   299
                    reporter.print(ERROR, getText("doclet.Option_conflict",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   300
                        "-helpfile", "-nohelp"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   301
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   302
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   303
                if (helpfileSeen) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   304
                    reporter.print(ERROR, getText("doclet.Option_reuse",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   305
                        "-helpfile"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   306
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   307
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   308
                helpfileSeen = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   309
                DocFile help = DocFile.createFileForInput(this, helpfile);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   310
                if (!help.exists()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   311
                    reporter.print(ERROR, getText("doclet.File_not_found", helpfile));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   312
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   313
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   314
            } else  if (opt.matches("-nohelp")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   315
                if (helpfileSeen) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   316
                    reporter.print(ERROR, getText("doclet.Option_conflict",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   317
                        "-nohelp", "-helpfile"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   318
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   319
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   320
            } else if (opt.matches("-xdocrootparent")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   321
                try {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   322
                    URL ignored = new URL(docrootparent);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   323
                } catch (MalformedURLException e) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   324
                    reporter.print(ERROR, getText("doclet.MalformedURL", docrootparent));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   325
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   326
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   327
            } else if (opt.matches("-overview")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   328
                if (nooverview == true) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   329
                    reporter.print(ERROR, getText("doclet.Option_conflict",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   330
                        "-overview", "-nooverview"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   331
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   332
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   333
            } else  if (opt.matches("-nooverview")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   334
                if (overviewpath != null) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   335
                    reporter.print(ERROR, getText("doclet.Option_conflict",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   336
                        "-nooverview", "-overview"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   337
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   338
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   339
            } else if (opt.matches("-splitindex")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   340
                if (createindex == false) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   341
                    reporter.print(ERROR, getText("doclet.Option_conflict",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   342
                        "-splitindex", "-noindex"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   343
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   344
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   345
            } else if (opt.matches("-noindex")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   346
                if (splitindex == true) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   347
                    reporter.print(ERROR, getText("doclet.Option_conflict",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   348
                        "-noindex", "-splitindex"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   349
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   350
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   351
            } else if (opt.matches("-xdoclint:")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   352
                String dopt = doclintOpts.get(opt);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   353
                if (dopt == null) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   354
                    continue;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   355
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   356
                if (dopt.contains("/")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   357
                    reporter.print(ERROR, getText("doclet.Option_doclint_no_qualifiers"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   358
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   359
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   360
                if (!DocLint.isValidOption(dopt)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   361
                    reporter.print(ERROR, getText("doclet.Option_doclint_invalid_arg"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   362
                    return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   363
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   364
            } else if (opt.matches("-xdoclint/package:")) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   365
                 String dopt = doclintOpts.get(opt);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   366
                    if (!DocLint.isValidOption(dopt)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   367
                        reporter.print(ERROR, getText("doclet.Option_doclint_package_invalid_arg"));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   368
                        return false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   369
                    }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   370
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   371
        }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   372
        return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   373
    }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   374
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   375
    @Override
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   376
    public boolean finishOptionSettings() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   377
        if (!validateOptions()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   378
            return false;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
        }
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 39181
diff changeset
   380
        if (!docEnv.getSpecifiedElements().isEmpty()) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   381
            Map<String, PackageElement> map = new HashMap<>();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   382
            PackageElement pkg;
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   383
            List<TypeElement> classes = new ArrayList<>(docEnv.getIncludedTypeElements());
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   384
            for (TypeElement aClass : classes) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   385
                pkg = utils.containingPackage(aClass);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   386
                if (!map.containsKey(utils.getPackageName(pkg))) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   387
                    map.put(utils.getPackageName(pkg), pkg);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
        setCreateOverview();
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 39181
diff changeset
   392
        setTopFile(docEnv);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   393
        workArounds.initDocLint(doclintOpts.values(), tagletManager.getCustomTagNames(),
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   394
                Utils.toLowerCase(htmlVersion.name()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
    /**
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   399
     * Return true if the generated output is HTML5.
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   400
     */
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   401
    public boolean isOutputHtml5() {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   402
        return htmlVersion == HtmlVersion.HTML5;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   403
    }
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   404
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   405
    /**
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   406
     * Return true if the tag is allowed for this specific version of HTML.
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   407
     */
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   408
    public boolean allowTag(HtmlTag htmlTag) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   409
        return htmlTag.allowTag(this.htmlVersion);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   410
    }
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   411
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   412
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
     * Decide the page which will appear first in the right-hand frame. It will
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
     * be "overview-summary.html" if "-overview" option is used or no
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
     * "-overview" but the number of packages is more than one. It will be
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
     * "package-summary.html" of the respective package if there is only one
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
     * package to document. It will be a class page(first in the sorted order),
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
     * if only classes are provided on the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
     *
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   420
     * @param docEnv the doclet environment
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
     */
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   422
    protected void setTopFile(DocletEnvironment docEnv) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   423
        if (!checkForDeprecation(docEnv)) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
        if (createoverview) {
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   427
            topFile = DocPaths.overviewSummary(frames);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
        } else {
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   429
            if (showModules) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   430
                topFile = DocPath.empty.resolve(DocPaths.moduleSummary(modules.first()));
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   431
            } else if (packages.size() == 1 && packages.first().isUnnamed()) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   432
                List<TypeElement> classes = new ArrayList<>(docEnv.getIncludedTypeElements());
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   433
                if (!classes.isEmpty()) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   434
                    TypeElement te = getValidClass(classes);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   435
                    topFile = DocPath.forClass(utils, te);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
                }
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 23968
diff changeset
   437
            } else if (!packages.isEmpty()) {
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 23968
diff changeset
   438
                topFile = DocPath.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   443
    protected TypeElement getValidClass(List<TypeElement> classes) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
        if (!nodeprecated) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   445
            return classes.get(0);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
        }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   447
        for (TypeElement te : classes) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   448
            if (!utils.isDeprecated(te)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   449
                return te;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 39181
diff changeset
   455
    protected boolean checkForDeprecation(DocletEnvironment docEnv) {
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   456
        for (TypeElement te : docEnv.getIncludedTypeElements()) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   457
            if (isGeneratedDoc(te)) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
                return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
        return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
     * Generate "overview.html" page if option "-overview" is used or number of
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
     * packages is more than one. Sets {@link #createoverview} field to true.
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
    protected void setCreateOverview() {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   469
        if ((overviewpath != null || packages.size() > 1) && !nooverview) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
            createoverview = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
     */
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   477
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
    public WriterFactory getWriterFactory() {
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   479
        return new WriterFactoryImpl(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
     */
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   485
    @Override
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   486
    public Locale getLocale() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   487
        if (locale == null)
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   488
            return Locale.getDefault();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   489
        return locale;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   490
    }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   491
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   492
    /**
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   493
     * Return the path of the overview file or null if it does not exist.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   494
     *
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   495
     * @return the path of the overview file or null if it does not exist.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   496
     */
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   497
    @Override
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   498
    public JavaFileObject getOverviewPath() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   499
        if (overviewpath != null && getFileManager() instanceof StandardJavaFileManager) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   500
            StandardJavaFileManager fm = (StandardJavaFileManager) getFileManager();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   501
            return fm.getJavaFileObjects(overviewpath).iterator().next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   502
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   503
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
    }
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   505
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   506
    /**
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   507
     * {@inheritDoc}
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   508
     */
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   509
    @Override
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   510
    public JavaFileManager getFileManager() {
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 39181
diff changeset
   511
        return docEnv.getJavaFileManager();
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   512
    }
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   513
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   514
    @Override
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   515
    public boolean showMessage(DocTreePath path, String key) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   516
        return (path == null || workArounds.haveDocLint());
14544
d71d992cb905 8002079: update DocFile to use a JavaFileManager
jjg
parents: 14542
diff changeset
   517
    }
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 14544
diff changeset
   518
15354
52a04c670c05 8004834: Add doclint support into javadoc
jjg
parents: 14545
diff changeset
   519
    @Override
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   520
    public boolean showMessage(Element e, String key) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   521
        return (e == null || workArounds.haveDocLint());
15354
52a04c670c05 8004834: Add doclint support into javadoc
jjg
parents: 14545
diff changeset
   522
    }
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 15354
diff changeset
   523
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 15354
diff changeset
   524
    @Override
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   525
    public String getText(String key) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   526
        return resources.getText(key);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   527
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   528
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   529
    @Override
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   530
    public String getText(String key, String... args) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   531
        return resources.getText(key, (Object[]) args);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   532
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   533
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   534
   /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   535
     * {@inheritdoc}
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   536
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   537
    @Override
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   538
    public Content getContent(String key) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   539
        return contents.getContent(key);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   540
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   541
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   542
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   543
     * Get the configuration string as a content.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   544
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   545
     * @param key the key to look for in the configuration file
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   546
     * @param o   string or content argument added to configuration text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   547
     * @return a content tree for the text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   548
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   549
    @Override
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   550
    public Content getContent(String key, Object o) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   551
        return contents.getContent(key, o);
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 15354
diff changeset
   552
    }
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   553
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   554
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   555
     * Get the configuration string as a content.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   556
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   557
     * @param key the key to look for in the configuration file
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   558
     * @param o1 resource argument
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   559
     * @param o2 resource argument
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   560
     * @return a content tree for the text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   561
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   562
    @Override
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   563
    public Content getContent(String key, Object o1, Object o2) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   564
        return contents.getContent(key, o1, o2);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   565
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   566
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   567
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   568
     * Get the configuration string as a content.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   569
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   570
     * @param key the key to look for in the configuration file
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   571
     * @param o0  string or content argument added to configuration text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   572
     * @param o1  string or content argument added to configuration text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   573
     * @param o2  string or content argument added to configuration text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   574
     * @return a content tree for the text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   575
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   576
    @Override
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   577
    public Content getContent(String key, Object o0, Object o1, Object o2) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   578
        return contents.getContent(key, o0, o1, o2);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   579
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39364
diff changeset
   580
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   581
    protected void buildSearchTagIndex() {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   582
        for (SearchIndexItem sii : tagSearchIndex) {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   583
            String tagLabel = sii.getLabel();
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   584
            Character unicode = (tagLabel.length() == 0)
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   585
                    ? '*'
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   586
                    : Character.toUpperCase(tagLabel.charAt(0));
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   587
            List<SearchIndexItem> list = tagSearchIndexMap.get(unicode);
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   588
            if (list == null) {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   589
                list = new ArrayList<>();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   590
                tagSearchIndexMap.put(unicode, list);
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   591
            }
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   592
            list.add(sii);
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   593
        }
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   594
        tagSearchIndexKeys = tagSearchIndexMap.keySet();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 31752
diff changeset
   595
    }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   596
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   597
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   598
    public Set<Doclet.Option> getSupportedOptions() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   599
        Doclet.Option[] options = {
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   600
            new Option(this, "-bottom", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   601
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   602
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   603
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   604
                    bottom = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   605
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   606
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   607
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   608
            new Option(this, "-charset", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   609
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   610
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   611
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   612
                    charset = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   613
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   614
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   615
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   616
            new Option(this, "-doctitle", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   617
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   618
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   619
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   620
                    doctitle = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   621
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   622
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   623
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   624
            new Option(this, "-footer", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   625
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   626
                public boolean process(String opt, ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   627
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   628
                    footer = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   629
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   630
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   631
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   632
            new Option(this, "-header", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   633
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   634
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   635
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   636
                    header = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   637
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   638
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   639
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   640
            new Option(this, "-helpfile", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   641
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   642
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   643
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   644
                    helpfile = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   645
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   646
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   647
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   648
            new Option(this, "-html4") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   649
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   650
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   651
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   652
                    htmlVersion = HtmlVersion.HTML4;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   653
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   654
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   655
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   656
            new Option(this, "-html5") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   657
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   658
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   659
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   660
                    htmlVersion = HtmlVersion.HTML5;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   661
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   662
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   663
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   664
            new Option(this, "-nohelp") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   665
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   666
                public boolean process(String opt, ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   667
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   668
                    nohelp = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   669
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   670
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   671
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   672
            new Option(this, "-nodeprecatedlist") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   673
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   674
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   675
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   676
                    nodeprecatedlist = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   677
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   678
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   679
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   680
            new Option(this, "-noindex") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   681
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   682
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   683
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   684
                    createindex = false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   685
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   686
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   687
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   688
            new Option(this, "-nonavbar") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   689
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   690
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   691
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   692
                    nonavbar = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   693
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   694
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   695
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   696
            new Hidden(this, "-nooverview") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   697
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   698
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   699
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   700
                    nooverview = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   701
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   702
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   703
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   704
            new Option(this, "-notree") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   705
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   706
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   707
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   708
                    createtree = false;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   709
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   710
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   711
            },
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40500
diff changeset
   712
            new Option(this, "-overview", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   713
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   714
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   715
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   716
                    overviewpath = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   717
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   718
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   719
            },
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   720
            new Option(this, "--frames") {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   721
                @Override
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   722
                public boolean process(String opt,  ListIterator<String> args) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   723
                    optionsProcessed.add(this);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   724
                    frames = true;
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   725
                    return true;
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   726
                }
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   727
            },
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   728
            new Option(this, "--no-frames") {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   729
                @Override
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   730
                public boolean process(String opt,  ListIterator<String> args) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   731
                    optionsProcessed.add(this);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   732
                    frames = false;
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   733
                    return true;
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   734
                }
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   735
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   736
            new Hidden(this, "-packagesheader", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   737
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   738
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   739
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   740
                    packagesheader = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   741
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   742
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   743
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   744
            new Option(this, "-splitindex") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   745
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   746
                public boolean process(String opt, ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   747
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   748
                    splitindex = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   749
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   750
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   751
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   752
            new Option(this, "-stylesheetfile", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   753
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   754
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   755
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   756
                    stylesheetfile = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   757
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   758
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   759
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   760
            new Option(this, "-top", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   761
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   762
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   763
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   764
                    top = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   765
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   766
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   767
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   768
            new Option(this, "-use") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   769
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   770
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   771
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   772
                    classuse = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   773
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   774
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   775
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   776
            new Option(this, "-windowtitle", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   777
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   778
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   779
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   780
                    windowtitle = args.next().replaceAll("\\<.*?>", "");
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   781
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   782
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   783
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   784
            new XOption(this, "-Xdoclint") {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   785
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   786
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   787
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   788
                    doclintOpts.put(this, DocLint.XMSGS_OPTION);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   789
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   790
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   791
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   792
            new XOption(this, "-Xdocrootparent", 1) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   793
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   794
                public boolean process(String opt, ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   795
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   796
                    docrootparent = args.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   797
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   798
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   799
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   800
            new XOption(this, "doclet.xusage.xdoclint-extended.", "-Xdoclint:", 0) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   801
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   802
                public boolean matches(String option) {
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   803
                    return option.toLowerCase().startsWith(getName().toLowerCase());
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   804
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   805
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   806
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   807
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   808
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   809
                    doclintOpts.put(this, opt.replace("-Xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   810
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   811
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   812
            },
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   813
            new XOption(this, "doclet.xusage.xdoclint-package.", "-Xdoclint/package:", 0) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   814
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   815
                public boolean matches(String option) {
39181
e2526131d705 8160135: The Html doclet handles options incorrectly
ksrini
parents: 36526
diff changeset
   816
                    return option.toLowerCase().startsWith(getName().toLowerCase());
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   817
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   818
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   819
                @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   820
                public boolean process(String opt,  ListIterator<String> args) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   821
                    optionsProcessed.add(this);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   822
                    doclintOpts.put(this, opt.replace("-Xdoclint/package:", DocLint.XCHECK_PACKAGE));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   823
                    return true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   824
                }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   825
            }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   826
        };
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   827
        Set<Doclet.Option> oset = new TreeSet<>();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   828
        oset.addAll(Arrays.asList(options));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   829
        oset.addAll(super.getSupportedOptions());
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   830
        return oset;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
   831
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   832
}