langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java
author jjg
Tue, 23 Oct 2012 13:20:37 -0700
changeset 14357 faf9cde2817b
parent 14259 fb94a1df0d53
child 14368 6f4c62de6985
permissions -rw-r--r--
8000741: refactor javadoc to use abstraction to handle relative paths Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
     2
 * Copyright (c) 1998, 2012, 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
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.formats.html;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 13842
diff changeset
    28
import java.io.*;
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
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
import com.sun.javadoc.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 13842
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.*;
8d2148961366 8000663: clean up langtools imports
jjg
parents: 13842
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.util.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * Configure the output based on the command line options.
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * Also determine the length of the command line option. For example,
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * for a option "-header" there will be a string argument associated, then the
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * the length of option "-header" is two. But for option "-nohelp" no argument
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * is needed so it's length is 1.
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * Also do the error checking on the options used. For example it is illegal to
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * use "-helpfile" option when already "-nohelp" option is used.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * @author Robert Field.
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 * @author Atul Dambalkar.
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 * @author Jamie Ho
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
    52
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
public class ConfigurationImpl extends Configuration {
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
    56
    private static ConfigurationImpl instance = new ConfigurationImpl();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     * The build date.  Note: For now, we will use
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     * a version number instead of a date.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    public static final String BUILD_DATE = System.getProperty("java.version");
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     * Argument for command line option "-header".
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    public String header = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * Argument for command line option "-packagesheader".
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    public String packagesheader = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     * Argument for command line option "-footer".
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
    public String footer = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     * Argument for command line option "-doctitle".
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    public String doctitle = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     * Argument for command line option "-windowtitle".
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    public String windowtitle = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     * Argument for command line option "-top".
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    public String top = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * Argument for command line option "-bottom".
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    public String bottom = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     * Argument for command line option "-helpfile".
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    public String helpfile = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
     * Argument for command line option "-stylesheetfile".
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    public String stylesheetfile = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    /**
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   110
     * Argument for command line option "-Xdocrootparent".
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   111
     */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   112
    public String docrootparent = "";
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   113
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   114
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
     * True if command line option "-nohelp" is used. Default value is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
    public boolean nohelp = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
     * True if command line option "-splitindex" is used. Default value is
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     * false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
    public boolean splitindex = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
     * False if command line option "-noindex" is used. Default value is true.
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
    public boolean createindex = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
     * True if command line option "-use" is used. Default value is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    public boolean classuse = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     * False if command line option "-notree" is used. Default value is true.
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
    public boolean createtree = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
     * True if command line option "-nodeprecated" is used. Default value is
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     * false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    public boolean nodeprecatedlist = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
     * True if command line option "-nonavbar" is used. Default value is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
    public boolean nonavbar = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     * True if command line option "-nooverview" is used. Default value is
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
     * false
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    private boolean nooverview = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     * True if command line option "-overview" is used. Default value is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    public boolean overview = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
     * This is true if option "-overview" is used or option "-overview" is not
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
     * used and number of packages is more than one.
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
    public boolean createoverview = 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
     * Unique Resource Handler for this package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    public final MessageRetriever standardmessage;
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * First file to appear in the right-hand frame in the generated
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     * documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     */
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14259
diff changeset
   177
    public DocPath topFile = DocPath.empty;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
     * The classdoc for the class file getting generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
    public ClassDoc currentcd = null;  // Set this classdoc in the
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    // ClassWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
    /**
14259
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 14258
diff changeset
   186
     * Constructor. Initializes resource for the
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 14258
diff changeset
   187
     * {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
    private ConfigurationImpl() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
        standardmessage = new MessageRetriever(this,
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
            "com.sun.tools.doclets.formats.html.resources.standard");
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   194
    /**
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   195
     * Reset to a fresh new ConfigurationImpl, to allow multiple invocations
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   196
     * of javadoc within a single VM. It would be better not to be using
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   197
     * static fields at all, but .... (sigh).
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   198
     */
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   199
    public static void reset() {
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   200
        instance = new ConfigurationImpl();
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   201
    }
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   202
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
    public static ConfigurationImpl getInstance() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
        return instance;
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
     * Return the build date for the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
    public String getDocletSpecificBuildDate() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
        return BUILD_DATE;
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
     * Depending upon the command line options provided by the user, set
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
     * configure the output generation environment.
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
     * @param options The array of option names and values.
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
    public void setSpecificDocletOptions(String[][] options) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        for (int oi = 0; oi < options.length; ++oi) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
            String[] os = options[oi];
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
            String opt = os[0].toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
            if (opt.equals("-footer")) {
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   225
                footer = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   226
            } else if (opt.equals("-header")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   227
                header = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   228
            } else if (opt.equals("-packagesheader")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   229
                packagesheader = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   230
            } else if (opt.equals("-doctitle")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   231
                doctitle = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   232
            } else if (opt.equals("-windowtitle")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   233
                windowtitle = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   234
            } else if (opt.equals("-top")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   235
                top = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   236
            } else if (opt.equals("-bottom")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   237
                bottom = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   238
            } else if (opt.equals("-helpfile")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   239
                helpfile = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   240
            } else if (opt.equals("-stylesheetfile")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   241
                stylesheetfile = os[1];
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   242
            } else if (opt.equals("-charset")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   243
                charset = os[1];
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   244
            } else if (opt.equals("-xdocrootparent")) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   245
                docrootparent = os[1];
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   246
            } else if (opt.equals("-nohelp")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
                nohelp = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   248
            } else if (opt.equals("-splitindex")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
                splitindex = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   250
            } else if (opt.equals("-noindex")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
                createindex = false;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   252
            } else if (opt.equals("-use")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
                classuse = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   254
            } else if (opt.equals("-notree")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
                createtree = false;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   256
            } else if (opt.equals("-nodeprecatedlist")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
                nodeprecatedlist = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   258
            } else if (opt.equals("-nonavbar")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
                nonavbar = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   260
            } else if (opt.equals("-nooverview")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
                nooverview = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9608
diff changeset
   262
            } else if (opt.equals("-overview")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
                overview = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
        if (root.specifiedClasses().length > 0) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   267
            Map<String,PackageDoc> map = new HashMap<String,PackageDoc>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
            PackageDoc pd;
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
            ClassDoc[] classes = root.classes();
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
            for (int i = 0; i < classes.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
                pd = classes[i].containingPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
                if(! map.containsKey(pd.name())) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
                    map.put(pd.name(), pd);
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
        setCreateOverview();
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
        setTopFile(root);
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
     * Returns the "length" of a given option. If an option takes no
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
     * arguments, its length is one. If it takes one argument, it's
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
     * length is two, and so on. This method is called by JavaDoc to
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
     * parse the options it does not recognize. It then calls
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
     * {@link #validOptions(String[][], DocErrorReporter)} to
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
     * validate them.
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
     * <b>Note:</b><br>
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
     * The options arrive as case-sensitive strings. For options that
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
     * are not case-sensitive, use toLowerCase() on the option string
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
     * before comparing it.
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
     * </blockquote>
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
     * @return number of arguments + 1 for a option. Zero return means
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
     * option not known.  Negative value means error occurred.
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
    public int optionLength(String option) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
        int result = -1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
        if ((result = super.optionLength(option)) > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            return result;
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
        // otherwise look for the options we have added
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
        option = option.toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
        if (option.equals("-nodeprecatedlist") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
            option.equals("-noindex") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
            option.equals("-notree") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
            option.equals("-nohelp") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
            option.equals("-splitindex") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
            option.equals("-serialwarn") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
            option.equals("-use") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
            option.equals("-nonavbar") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
            option.equals("-nooverview")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
            return 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
        } else if (option.equals("-help")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
            System.out.println(getText("doclet.usage"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
            return 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        } else if (option.equals("-footer") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
                   option.equals("-header") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
                   option.equals("-packagesheader") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
                   option.equals("-doctitle") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
                   option.equals("-windowtitle") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
                   option.equals("-top") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
                   option.equals("-bottom") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
                   option.equals("-helpfile") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
                   option.equals("-stylesheetfile") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
                   option.equals("-charset") ||
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   327
                   option.equals("-overview") ||
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   328
                   option.equals("-xdocrootparent")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
            return 2;
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
            return 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
    public boolean validOptions(String options[][],
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
            DocErrorReporter reporter) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
        boolean helpfile = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
        boolean nohelp = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
        boolean overview = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
        boolean nooverview = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
        boolean splitindex = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
        boolean noindex = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
        // check shared options
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
        if (!generalValidOptions(options, reporter)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
            return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
        // otherwise look at our options
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
        for (int oi = 0; oi < options.length; ++oi) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
            String[] os = options[oi];
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
            String opt = os[0].toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
            if (opt.equals("-helpfile")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
                if (nohelp == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
                    reporter.printError(getText("doclet.Option_conflict",
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
                        "-helpfile", "-nohelp"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
                if (helpfile == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
                    reporter.printError(getText("doclet.Option_reuse",
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
                        "-helpfile"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
                File help = new File(os[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
                if (!help.exists()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
                    reporter.printError(getText("doclet.File_not_found", os[1]));
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
                helpfile = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
            } else  if (opt.equals("-nohelp")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
                if (helpfile == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
                    reporter.printError(getText("doclet.Option_conflict",
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
                        "-nohelp", "-helpfile"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
                nohelp = true;
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   378
            } else if (opt.equals("-xdocrootparent")) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   379
                try {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   380
                    new URL(os[1]);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   381
                } catch (MalformedURLException e) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   382
                    reporter.printError(getText("doclet.MalformedURL", os[1]));
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   383
                    return false;
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 5520
diff changeset
   384
                }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
            } else if (opt.equals("-overview")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
                if (nooverview == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
                    reporter.printError(getText("doclet.Option_conflict",
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
                        "-overview", "-nooverview"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
                if (overview == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
                    reporter.printError(getText("doclet.Option_reuse",
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
                        "-overview"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
                overview = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
            } else  if (opt.equals("-nooverview")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
                if (overview == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
                    reporter.printError(getText("doclet.Option_conflict",
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
                        "-nooverview", "-overview"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
                nooverview = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
            } else if (opt.equals("-splitindex")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
                if (noindex == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
                    reporter.printError(getText("doclet.Option_conflict",
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
                        "-splitindex", "-noindex"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
                splitindex = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
            } else if (opt.equals("-noindex")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
                if (splitindex == true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
                    reporter.printError(getText("doclet.Option_conflict",
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
                        "-noindex", "-splitindex"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
                noindex = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
    public MessageRetriever getDocletSpecificMsg() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
        return standardmessage;
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
     * Decide the page which will appear first in the right-hand frame. It will
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
     * be "overview-summary.html" if "-overview" option is used or no
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
     * "-overview" but the number of packages is more than one. It will be
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
     * "package-summary.html" of the respective package if there is only one
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
     * package to document. It will be a class page(first in the sorted order),
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
     * if only classes are provided on the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   438
     * @param root Root of the program structure.
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
    protected void setTopFile(RootDoc root) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
        if (!checkForDeprecation(root)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
        if (createoverview) {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14259
diff changeset
   445
            topFile = DocPaths.OVERVIEW_SUMMARY;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
            if (packages.length == 1 && packages[0].name().equals("")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
                if (root.classes().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
                    ClassDoc[] classarr = root.classes();
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
                    Arrays.sort(classarr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
                    ClassDoc cd = getValidClass(classarr);
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14259
diff changeset
   452
                    topFile = DocPath.forClass(cd);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
            } else {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14259
diff changeset
   455
                topFile = DocPath.forPackage(packages[0]).resolve(DocPaths.PACKAGE_SUMMARY);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   456
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   457
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
    protected ClassDoc getValidClass(ClassDoc[] classarr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
        if (!nodeprecated) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
            return classarr[0];
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
        for (int i = 0; i < classarr.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
            if (classarr[i].tags("deprecated").length == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
                return classarr[i];
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
    protected boolean checkForDeprecation(RootDoc root) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
        ClassDoc[] classarr = root.classes();
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
        for (int i = 0; i < classarr.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
            if (isGeneratedDoc(classarr[i])) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
                return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
        return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
     * Generate "overview.html" page if option "-overview" is used or number of
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
     * packages is more than one. Sets {@link #createoverview} field to true.
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
    protected void setCreateOverview() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   487
        if ((overview || packages.length > 1) && !nooverview) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
            createoverview = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
06bc494ca11e Initial load
duke
parents:
diff changeset
   492
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   493
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   494
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
    public WriterFactory getWriterFactory() {
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   496
        return new WriterFactoryImpl(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
06bc494ca11e Initial load
duke
parents:
diff changeset
   499
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   502
    public Comparator<ProgramElementDoc> getMemberComparator() {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   503
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
    }
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   505
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   506
    /**
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   507
     * {@inheritDoc}
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   508
     */
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   509
    public Locale getLocale() {
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   510
        if (root instanceof com.sun.tools.javadoc.RootDocImpl)
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   511
            return ((com.sun.tools.javadoc.RootDocImpl)root).getLocale();
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   512
        else
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   513
            return Locale.getDefault();
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1475
diff changeset
   514
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   515
}