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