langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
author jjg
Tue, 09 Oct 2012 19:10:00 -0700
changeset 14258 8d2148961366
parent 14061 9ac68cf0048b
child 14260 727a84636f12
permissions -rw-r--r--
8000663: clean up langtools imports 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: 9606
diff changeset
     2
 * Copyright (c) 1997, 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.internal.toolkit;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 14061
diff changeset
    28
import java.io.*;
8d2148961366 8000663: clean up langtools imports
jjg
parents: 14061
diff changeset
    29
import java.util.*;
8d2148961366 8000663: clean up langtools imports
jjg
parents: 14061
diff changeset
    30
8d2148961366 8000663: clean up langtools imports
jjg
parents: 14061
diff changeset
    31
import com.sun.javadoc.*;
8d2148961366 8000663: clean up langtools imports
jjg
parents: 14061
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.builders.BuilderFactory;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.taglets.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.util.*;
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 options. Doclets should sub-class
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * Configuration, to configure and add their own options. This class contains
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * all user options which are supported by the 1.1 doclet and the standard
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * This code is not part of an API.
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * It is implementation that is subject to change.
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * Do not use it as an API
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * @author Robert Field.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * @author Atul Dambalkar.
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
public abstract class Configuration {
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     * The factory for builders.
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
    protected BuilderFactory builderFactory;
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
     * The taglet manager.
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    public TagletManager tagletManager;
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     * The path to the builder XML input file.
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    public String builderXMLPath;
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * The default path to the builder XML.
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    private static final String DEFAULT_BUILDER_XML = "resources/doclet.xml";
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     * The path to Taglets
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    public String tagletpath = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     * This is true if option "-serialwarn" is used. Defualt value is false to
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     * supress excessive warnings about serial tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    public boolean serialwarn = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     * The specified amount of space between tab stops.
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    public int sourcetab = DocletConstants.DEFAULT_TAB_STOP_LENGTH;
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     * True if we should generate browsable sources.
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    public boolean linksource = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     * True if command line option "-nosince" is used. Default value is
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * false.
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    public boolean nosince = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     * True if we should recursively copy the doc-file subdirectories
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    public boolean copydocfilesubdirs = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
     * The META charset tag used for cross-platform viewing.
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    public String charset = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     * True if user wants to add member names as meta keywords.
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     * Set to false because meta keywords are ignored in general
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     * by most Internet search engines.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
    public boolean keywords = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
    /**
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   117
     * The meta tag keywords instance.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
     */
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   119
    public final MetaKeywords metakeywords = new MetaKeywords(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
     * The list of doc-file subdirectories to exclude
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   124
    protected Set<String> excludedDocFileDirs;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     * The list of qualifiers to exclude
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   129
    protected Set<String> excludedQualifiers;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
     * The Root of the generated Program Structure from the Doclet API.
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
    public RootDoc root;
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     * Destination directory name, in which doclet will generate the entire
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
     * documentation. Default is current directory.
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
    public String destDirName = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     * Destination directory name, in which doclet will copy the doc-files to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
    public String docFileDestDirName = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     * Encoding for this document. Default is default encoding for this
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     * platform.
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
    public String docencoding = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     * True if user wants to suppress descriptions and tags.
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    public boolean nocomment = 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
     * Encoding for this document. Default is default encoding for this
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
     * platform.
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    public String encoding = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
     * Generate author specific information for all the classes if @author
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     * tag is used in the doc comment and if -author option is used.
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
     * <code>showauthor</code> is set to true if -author option is used.
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
     * Default is don't show author information.
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    public boolean showauthor = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     * Generate version specific information for the all the classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * if @version tag is used in the doc comment and if -version option is
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     * used. <code>showversion</code> is set to true if -version option is
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     * used.Default is don't show version information.
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
    public boolean showversion = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     * Sourcepath from where to read the source files. Default is classpath.
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
    public String sourcepath = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
     * Don't generate deprecated API information at all, if -nodeprecated
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
     * option is used. <code>nodepracted</code> is set to true if
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
     * -nodeprecated option is used. Default is generate deprected API
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
     * information.
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
    public boolean nodeprecated = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
     * The catalog of classes specified on the command-line
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
    public ClassDocCatalog classDocCatalog;
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
     * Message Retriever for the doclet, to retrieve message from the resource
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
     * file for this Configuration, which is common for 1.1 and standard
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
     * doclets.
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
     * TODO:  Make this private!!!
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
    public MessageRetriever message = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
     * True if user wants to suppress time stamp in output.
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
     * Default is false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
    public boolean notimestamp= false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
    /**
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   215
     * The package grouping instance.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
     */
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   217
    public final Group group = new Group(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
    /**
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
   220
     * The tracker of external package links.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    public final Extern extern = new Extern(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
     * Return the build date for the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    public abstract String getDocletSpecificBuildDate();
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
     * This method should be defined in all those doclets(configurations),
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
     * which want to derive themselves from this Configuration. This method
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
     * can be used to set its own command line options.
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
     * @param options The array of option names and values.
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
     * @throws DocletAbortException
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
    public abstract void setSpecificDocletOptions(String[][] options);
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
     * Return the doclet specific {@link MessageRetriever}
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
     * @return the doclet specific MessageRetriever.
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    public abstract MessageRetriever getDocletSpecificMsg();
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
     * An array of the packages specified on the command-line merged
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
     * with the array of packages that contain the classes specified on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
     * command-line.  The array is sorted.
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
    public PackageDoc[] packages;
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
     * Constructor. Constructs the message retriever with resource file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
    public Configuration() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
        message =
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
            new MessageRetriever(this,
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
            "com.sun.tools.doclets.internal.toolkit.resources.doclets");
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   259
        excludedDocFileDirs = new HashSet<String>();
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   260
        excludedQualifiers = new HashSet<String>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
     * Return the builder factory for this doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
     * @return the builder factory for this doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
    public BuilderFactory getBuilderFactory() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
        if (builderFactory == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
            builderFactory = new BuilderFactory(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
        return builderFactory;
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
     * This method should be defined in all those doclets
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
     * which want to inherit from this Configuration. This method
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
     * should return the number of arguments to the command line
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
     * option (including the option name).  For example,
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
     * -notimestamp is a single-argument option, so this method would
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
     * return 1.
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
     * @param option Command line option under consideration.
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
     * @return number of arguments to option (including the
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
     * option name). Zero return means option not known.
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
     * Negative value means error occurred.
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
    public int optionLength(String option) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
        option = option.toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
        if (option.equals("-author") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
            option.equals("-docfilessubdirs") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
            option.equals("-keywords") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
            option.equals("-linksource") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
            option.equals("-nocomment") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
            option.equals("-nodeprecated") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
            option.equals("-nosince") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
            option.equals("-notimestamp") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
            option.equals("-quiet") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
            option.equals("-xnodate") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            option.equals("-version")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
            return 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
        } else if (option.equals("-d") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
                   option.equals("-docencoding") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
                   option.equals("-encoding") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
                   option.equals("-excludedocfilessubdir") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
                   option.equals("-link") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
                   option.equals("-sourcetab") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
                   option.equals("-noqualifier") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
                   option.equals("-output") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
                   option.equals("-sourcepath") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
                   option.equals("-tag") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
                   option.equals("-taglet") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
                   option.equals("-tagletpath")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
            return 2;
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        } else if (option.equals("-group") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
                   option.equals("-linkoffline")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
            return 3;
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
            return -1;  // indicate we don't know about it
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
     * Perform error checking on the given options.
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
     * @param options  the given options to check.
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
     * @param reporter the reporter used to report errors.
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
    public abstract boolean validOptions(String options[][],
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
        DocErrorReporter reporter);
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
    private void initPackageArray() {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   333
        Set<PackageDoc> set = new HashSet<PackageDoc>(Arrays.asList(root.specifiedPackages()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
        ClassDoc[] classes = root.specifiedClasses();
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
        for (int i = 0; i < classes.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
            set.add(classes[i].containingPackage());
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
        }
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   338
        ArrayList<PackageDoc> results = new ArrayList<PackageDoc>(set);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
        Collections.sort(results);
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   340
        packages = results.toArray(new PackageDoc[] {});
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
     * Set the command line options supported by this configuration.
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
     * @param options the two dimensional array of options.
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
    public void setOptions(String[][] options) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   349
        LinkedHashSet<String[]> customTagStrs = new LinkedHashSet<String[]>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
        for (int oi = 0; oi < options.length; ++oi) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
            String[] os = options[oi];
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
            String opt = os[0].toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
            if (opt.equals("-d")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
                destDirName = addTrailingFileSep(os[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
                docFileDestDirName = destDirName;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   356
            } else if (opt.equals("-docfilessubdirs")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
                copydocfilesubdirs = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   358
            } else if (opt.equals("-docencoding")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
                docencoding = os[1];
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   360
            } else if (opt.equals("-encoding")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
                encoding = os[1];
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   362
            } else if (opt.equals("-author")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
                showauthor = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   364
            } else if (opt.equals("-nosince")) {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   365
                nosince = true;
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   366
            } else if (opt.equals("-version")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
                showversion = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   368
            } else if (opt.equals("-nodeprecated")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
                nodeprecated = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   370
            } else if (opt.equals("-sourcepath")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
                sourcepath = os[1];
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
            } else if (opt.equals("-classpath") &&
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
                       sourcepath.length() == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
                sourcepath = os[1];
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
            } else if (opt.equals("-excludedocfilessubdir")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
                addToSet(excludedDocFileDirs, os[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
            } else if (opt.equals("-noqualifier")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
                addToSet(excludedQualifiers, os[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
            } else if (opt.equals("-linksource")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
                linksource = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
            } else if (opt.equals("-sourcetab")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
                linksource = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
                try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
                    sourcetab = Integer.parseInt(os[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
                } catch (NumberFormatException e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
                    //Set to -1 so that warning will be printed
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
                    //to indicate what is valid argument.
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
                    sourcetab = -1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
                if (sourcetab <= 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
                    message.warning("doclet.sourcetab_warning");
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
                    sourcetab = DocletConstants.DEFAULT_TAB_STOP_LENGTH;
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
                }
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   394
            } else if (opt.equals("-notimestamp")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
                notimestamp = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   396
            } else if (opt.equals("-nocomment")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
                nocomment = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
            } else if (opt.equals("-tag") || opt.equals("-taglet")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
                customTagStrs.add(os);
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
            } else if (opt.equals("-tagletpath")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
                tagletpath = os[1];
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   402
            } else if (opt.equals("-keywords")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
                keywords = true;
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents: 9606
diff changeset
   404
            } else if (opt.equals("-serialwarn")) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
                serialwarn = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
            } else if (opt.equals("-group")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
                group.checkPackageGroups(os[1], os[2]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
            } else if (opt.equals("-link")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
                String url = os[1];
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
                extern.url(url, url, root, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
            } else if (opt.equals("-linkoffline")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
                String url = os[1];
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
                String pkglisturl = os[2];
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
                extern.url(url, pkglisturl, root, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
        if (sourcepath.length() == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
            sourcepath = System.getProperty("env.class.path") == null ? "" :
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
                System.getProperty("env.class.path");
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
        if (docencoding == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
            docencoding = encoding;
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   425
        classDocCatalog = new ClassDocCatalog(root.specifiedClasses(), this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
        initTagletManager(customTagStrs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
     * Set the command line options supported by this configuration.
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
     * @throws DocletAbortException
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
    public void setOptions() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
        initPackageArray();
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
        setOptions(root.options());
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
        setSpecificDocletOptions(root.options());
06bc494ca11e Initial load
duke
parents:
diff changeset
   438
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
     * Initialize the taglet manager.  The strings to initialize the simple custom tags should
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
     * be in the following format:  "[tag name]:[location str]:[heading]".
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
     * @param customTagStrs the set two dimentional arrays of strings.  These arrays contain
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
     * either -tag or -taglet arguments.
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
     */
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1475
diff changeset
   447
    private void initTagletManager(Set<String[]> customTagStrs) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
        tagletManager = tagletManager == null ?
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
            new TagletManager(nosince, showversion, showauthor, message) :
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
            tagletManager;
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
        String[] args;
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1475
diff changeset
   452
        for (Iterator<String[]> it = customTagStrs.iterator(); it.hasNext(); ) {
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1475
diff changeset
   453
            args = it.next();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
            if (args[0].equals("-taglet")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   455
                tagletManager.addCustomTag(args[1], tagletpath);
06bc494ca11e Initial load
duke
parents:
diff changeset
   456
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   457
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
            String[] tokens = Util.tokenize(args[1],
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
                TagletManager.SIMPLE_TAGLET_OPT_SEPERATOR, 3);
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
            if (tokens.length == 1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
                String tagName = args[1];
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
                if (tagletManager.isKnownCustomTag(tagName)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
                    //reorder a standard tag
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
                    tagletManager.addNewSimpleCustomTag(tagName, null, "");
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
                } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
                    //Create a simple tag with the heading that has the same name as the tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
                    StringBuffer heading = new StringBuffer(tagName + ":");
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
                    heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0)));
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
                    tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a");
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
            } else if (tokens.length == 2) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
                //Add simple taglet without heading, probably to excluding it in the output.
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
                tagletManager.addNewSimpleCustomTag(tokens[0], tokens[1], "");
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
            } else if (tokens.length >= 3) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
                tagletManager.addNewSimpleCustomTag(tokens[0], tokens[2], tokens[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
                message.error("doclet.Error_invalid_custom_tag_argument", args[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   482
    private void addToSet(Set<String> s, String str){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
        StringTokenizer st = new StringTokenizer(str, ":");
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
        String current;
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
        while(st.hasMoreTokens()){
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
            current = st.nextToken();
06bc494ca11e Initial load
duke
parents:
diff changeset
   487
            s.add(current);
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
    /**
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents: 13842
diff changeset
   492
     * Add a trailing file separator, if not found. Remove superfluous
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents: 13842
diff changeset
   493
     * file separators if any. Preserve the front double file separator for
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents: 13842
diff changeset
   494
     * UNC paths.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   496
     * @param path Path under consideration.
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
     * @return String Properly constructed path string.
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
     */
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents: 13842
diff changeset
   499
    public static String addTrailingFileSep(String path) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
        String fs = System.getProperty("file.separator");
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
        String dblfs = fs + fs;
06bc494ca11e Initial load
duke
parents:
diff changeset
   502
        int indexDblfs;
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents: 13842
diff changeset
   503
        while ((indexDblfs = path.indexOf(dblfs, 1)) >= 0) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
            path = path.substring(0, indexDblfs) +
06bc494ca11e Initial load
duke
parents:
diff changeset
   505
                path.substring(indexDblfs + fs.length());
06bc494ca11e Initial load
duke
parents:
diff changeset
   506
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   507
        if (!path.endsWith(fs))
06bc494ca11e Initial load
duke
parents:
diff changeset
   508
            path += fs;
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
        return path;
06bc494ca11e Initial load
duke
parents:
diff changeset
   510
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   511
06bc494ca11e Initial load
duke
parents:
diff changeset
   512
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   513
     * This checks for the validity of the options used by the user.
06bc494ca11e Initial load
duke
parents:
diff changeset
   514
     * This works exactly like
06bc494ca11e Initial load
duke
parents:
diff changeset
   515
     * {@link com.sun.javadoc.Doclet#validOptions(String[][],
06bc494ca11e Initial load
duke
parents:
diff changeset
   516
     * DocErrorReporter)}. This will validate the options which are shared
06bc494ca11e Initial load
duke
parents:
diff changeset
   517
     * by our doclets. For example, this method will flag an error using
06bc494ca11e Initial load
duke
parents:
diff changeset
   518
     * the DocErrorReporter if user has used "-nohelp" and "-helpfile" option
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
     * together.
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   521
     * @param options  options used on the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
     * @param reporter used to report errors.
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
     * @return true if all the options are valid.
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   525
    public boolean generalValidOptions(String options[][],
06bc494ca11e Initial load
duke
parents:
diff changeset
   526
            DocErrorReporter reporter) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   527
        boolean docencodingfound = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   528
        String encoding = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   529
        for (int oi = 0; oi < options.length; oi++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   530
            String[] os = options[oi];
06bc494ca11e Initial load
duke
parents:
diff changeset
   531
            String opt = os[0].toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   532
            if (opt.equals("-d")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
                String destdirname = addTrailingFileSep(os[1]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
                File destDir = new File(destdirname);
06bc494ca11e Initial load
duke
parents:
diff changeset
   535
                if (!destDir.exists()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   536
                    //Create the output directory (in case it doesn't exist yet)
06bc494ca11e Initial load
duke
parents:
diff changeset
   537
                    reporter.printNotice(getText("doclet.dest_dir_create",
06bc494ca11e Initial load
duke
parents:
diff changeset
   538
                        destdirname));
06bc494ca11e Initial load
duke
parents:
diff changeset
   539
                    (new File(destdirname)).mkdirs();
06bc494ca11e Initial load
duke
parents:
diff changeset
   540
                } else if (!destDir.isDirectory()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   541
                    reporter.printError(getText(
06bc494ca11e Initial load
duke
parents:
diff changeset
   542
                        "doclet.destination_directory_not_directory_0",
06bc494ca11e Initial load
duke
parents:
diff changeset
   543
                        destDir.getPath()));
06bc494ca11e Initial load
duke
parents:
diff changeset
   544
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   545
                } else if (!destDir.canWrite()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   546
                    reporter.printError(getText(
06bc494ca11e Initial load
duke
parents:
diff changeset
   547
                        "doclet.destination_directory_not_writable_0",
06bc494ca11e Initial load
duke
parents:
diff changeset
   548
                        destDir.getPath()));
06bc494ca11e Initial load
duke
parents:
diff changeset
   549
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   550
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   551
            } else if (opt.equals("-docencoding")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   552
                docencodingfound = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   553
                if (!checkOutputFileEncoding(os[1], reporter)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   554
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   555
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   556
            } else if (opt.equals("-encoding")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   557
                encoding = os[1];
06bc494ca11e Initial load
duke
parents:
diff changeset
   558
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   559
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   560
        if (!docencodingfound && encoding.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   561
            if (!checkOutputFileEncoding(encoding, reporter)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   562
                return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   563
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   564
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   565
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   566
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   567
06bc494ca11e Initial load
duke
parents:
diff changeset
   568
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   569
     * Check the validity of the given Source or Output File encoding on this
06bc494ca11e Initial load
duke
parents:
diff changeset
   570
     * platform.
06bc494ca11e Initial load
duke
parents:
diff changeset
   571
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   572
     * @param docencoding output file encoding.
06bc494ca11e Initial load
duke
parents:
diff changeset
   573
     * @param reporter    used to report errors.
06bc494ca11e Initial load
duke
parents:
diff changeset
   574
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   575
    private boolean checkOutputFileEncoding(String docencoding,
06bc494ca11e Initial load
duke
parents:
diff changeset
   576
            DocErrorReporter reporter) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   577
        OutputStream ost= new ByteArrayOutputStream();
06bc494ca11e Initial load
duke
parents:
diff changeset
   578
        OutputStreamWriter osw = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   579
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   580
            osw = new OutputStreamWriter(ost, docencoding);
06bc494ca11e Initial load
duke
parents:
diff changeset
   581
        } catch (UnsupportedEncodingException exc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   582
            reporter.printError(getText("doclet.Encoding_not_supported",
06bc494ca11e Initial load
duke
parents:
diff changeset
   583
                docencoding));
06bc494ca11e Initial load
duke
parents:
diff changeset
   584
            return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   585
        } finally {
06bc494ca11e Initial load
duke
parents:
diff changeset
   586
            try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   587
                if (osw != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   588
                    osw.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   589
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   590
            } catch (IOException exc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   591
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   592
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   593
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   594
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   595
06bc494ca11e Initial load
duke
parents:
diff changeset
   596
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   597
     * Return true if the given doc-file subdirectory should be excluded and
06bc494ca11e Initial load
duke
parents:
diff changeset
   598
     * false otherwise.
06bc494ca11e Initial load
duke
parents:
diff changeset
   599
     * @param docfilesubdir the doc-files subdirectory to check.
06bc494ca11e Initial load
duke
parents:
diff changeset
   600
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   601
    public boolean shouldExcludeDocFileDir(String docfilesubdir){
06bc494ca11e Initial load
duke
parents:
diff changeset
   602
        if (excludedDocFileDirs.contains(docfilesubdir)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   603
            return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   604
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   605
            return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   606
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   607
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   608
06bc494ca11e Initial load
duke
parents:
diff changeset
   609
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   610
     * Return true if the given qualifier should be excluded and false otherwise.
06bc494ca11e Initial load
duke
parents:
diff changeset
   611
     * @param qualifier the qualifier to check.
06bc494ca11e Initial load
duke
parents:
diff changeset
   612
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   613
    public boolean shouldExcludeQualifier(String qualifier){
06bc494ca11e Initial load
duke
parents:
diff changeset
   614
        if (excludedQualifiers.contains("all") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   615
            excludedQualifiers.contains(qualifier) ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   616
            excludedQualifiers.contains(qualifier + ".*")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   617
            return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   618
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   619
            int index = -1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   620
            while ((index = qualifier.indexOf(".", index + 1)) != -1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   621
                if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   622
                    return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   623
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   624
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   625
            return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   626
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   627
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   628
06bc494ca11e Initial load
duke
parents:
diff changeset
   629
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   630
     * Return the qualified name of the <code>ClassDoc</code> if it's qualifier is not excluded.  Otherwise,
06bc494ca11e Initial load
duke
parents:
diff changeset
   631
     * return the unqualified <code>ClassDoc</code> name.
06bc494ca11e Initial load
duke
parents:
diff changeset
   632
     * @param cd the <code>ClassDoc</code> to check.
06bc494ca11e Initial load
duke
parents:
diff changeset
   633
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   634
    public String getClassName(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   635
        PackageDoc pd = cd.containingPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
   636
        if (pd != null && shouldExcludeQualifier(cd.containingPackage().name())) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   637
            return cd.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
   638
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   639
            return cd.qualifiedName();
06bc494ca11e Initial load
duke
parents:
diff changeset
   640
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   641
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   642
06bc494ca11e Initial load
duke
parents:
diff changeset
   643
    public String getText(String key) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   644
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   645
            //Check the doclet specific properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   646
            return getDocletSpecificMsg().getText(key);
06bc494ca11e Initial load
duke
parents:
diff changeset
   647
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   648
            //Check the shared properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   649
            return message.getText(key);
06bc494ca11e Initial load
duke
parents:
diff changeset
   650
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   651
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   652
06bc494ca11e Initial load
duke
parents:
diff changeset
   653
    public String getText(String key, String a1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   654
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   655
            //Check the doclet specific properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   656
            return getDocletSpecificMsg().getText(key, a1);
06bc494ca11e Initial load
duke
parents:
diff changeset
   657
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   658
            //Check the shared properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   659
            return message.getText(key, a1);
06bc494ca11e Initial load
duke
parents:
diff changeset
   660
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   661
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   662
06bc494ca11e Initial load
duke
parents:
diff changeset
   663
    public String getText(String key, String a1, String a2) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   664
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   665
            //Check the doclet specific properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   666
            return getDocletSpecificMsg().getText(key, a1, a2);
06bc494ca11e Initial load
duke
parents:
diff changeset
   667
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   668
            //Check the shared properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   669
            return message.getText(key, a1, a2);
06bc494ca11e Initial load
duke
parents:
diff changeset
   670
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   671
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   672
06bc494ca11e Initial load
duke
parents:
diff changeset
   673
    public String getText(String key, String a1, String a2, String a3) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   674
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   675
            //Check the doclet specific properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   676
            return getDocletSpecificMsg().getText(key, a1, a2, a3);
06bc494ca11e Initial load
duke
parents:
diff changeset
   677
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   678
            //Check the shared properties file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   679
            return message.getText(key, a1, a2, a3);
06bc494ca11e Initial load
duke
parents:
diff changeset
   680
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   681
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   682
06bc494ca11e Initial load
duke
parents:
diff changeset
   683
    /**
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   684
     * Return true if the ClassDoc element is getting documented, depending upon
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   685
     * -nodeprecated option and the deprecation information. Return true if
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   686
     * -nodeprecated is not used. Return false if -nodeprecated is used and if
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   687
     * either ClassDoc element is deprecated or the containing package is deprecated.
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   688
     *
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   689
     * @param cd the ClassDoc for which the page generation is checked
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   690
     */
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   691
    public boolean isGeneratedDoc(ClassDoc cd) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   692
        if (!nodeprecated) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   693
            return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   694
        }
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 5520
diff changeset
   695
        return !(Util.isDeprecated(cd) || Util.isDeprecated(cd.containingPackage()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   696
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   697
06bc494ca11e Initial load
duke
parents:
diff changeset
   698
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   699
     * Return the doclet specific instance of a writer factory.
06bc494ca11e Initial load
duke
parents:
diff changeset
   700
     * @return the {@link WriterFactory} for the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   701
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   702
    public abstract WriterFactory getWriterFactory();
06bc494ca11e Initial load
duke
parents:
diff changeset
   703
06bc494ca11e Initial load
duke
parents:
diff changeset
   704
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   705
     * Return the input stream to the builder XML.
06bc494ca11e Initial load
duke
parents:
diff changeset
   706
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   707
     * @return the input steam to the builder XML.
06bc494ca11e Initial load
duke
parents:
diff changeset
   708
     * @throws FileNotFoundException when the given XML file cannot be found.
06bc494ca11e Initial load
duke
parents:
diff changeset
   709
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   710
    public InputStream getBuilderXML() throws FileNotFoundException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   711
        return builderXMLPath == null ?
06bc494ca11e Initial load
duke
parents:
diff changeset
   712
            Configuration.class.getResourceAsStream(DEFAULT_BUILDER_XML) :
06bc494ca11e Initial load
duke
parents:
diff changeset
   713
            new FileInputStream(new File(builderXMLPath));
06bc494ca11e Initial load
duke
parents:
diff changeset
   714
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   715
06bc494ca11e Initial load
duke
parents:
diff changeset
   716
    /**
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1789
diff changeset
   717
     * Return the Locale for this document.
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1789
diff changeset
   718
     */
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1789
diff changeset
   719
    public abstract Locale getLocale();
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1789
diff changeset
   720
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents: 1789
diff changeset
   721
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   722
     * Return the comparator that will be used to sort member documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   723
     * To no do any sorting, return null.
06bc494ca11e Initial load
duke
parents:
diff changeset
   724
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   725
     * @return the {@link java.util.Comparator} used to sort members.
06bc494ca11e Initial load
duke
parents:
diff changeset
   726
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   727
    public abstract Comparator<ProgramElementDoc> getMemberComparator();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   728
}