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