langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
author jjg
Mon, 22 Aug 2016 16:32:40 -0700
changeset 40587 1c355ea550ed
parent 40500 f293dbb81a53
child 42277 2668b0bc7ad7
permissions -rw-r--r--
8164130: Simplify doclet IOException handling Reviewed-by: bpatel, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
     2
 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1652
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: 1652
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: 1652
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1652
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1652
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
34752
9c262a013456 8145342: Some copyright notices are inconsistently and ill formatted
vasya
parents: 33920
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9894
diff changeset
    28
import java.util.*;
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9894
diff changeset
    29
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    30
import javax.lang.model.element.ModuleElement;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    31
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    32
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    33
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    34
import jdk.javadoc.doclet.Doclet.Option;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    35
import jdk.javadoc.doclet.DocletEnvironment;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    36
import jdk.javadoc.doclet.Reporter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.AbstractDoclet;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    38
import jdk.javadoc.internal.doclets.toolkit.DocletException;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
    39
import jdk.javadoc.internal.doclets.toolkit.Messages;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    40
import jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    41
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    42
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    43
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    44
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    45
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    46
import jdk.javadoc.internal.doclets.toolkit.util.IndexBuilder;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * The class with "start" method, calls individual Writers.
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    51
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    52
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    53
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    54
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    55
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
public class HtmlDoclet extends AbstractDoclet {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    62
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 10
diff changeset
    63
    public HtmlDoclet() {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    64
        configuration = new ConfigurationImpl();
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 10
diff changeset
    65
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
    67
    @Override // defined by Doclet
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
    68
    public String getName() {
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
    69
        return "Html";
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
    70
    }
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
    71
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     * The global configuration information for this run.
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
     */
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
    75
    private final ConfigurationImpl configuration;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
    76
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
    77
    private Messages messages;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    79
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    80
    private static final DocPath DOCLET_RESOURCES = DocPath
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    81
            .create("/jdk/javadoc/internal/doclets/formats/html/resources");
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    82
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
    83
    @Override // defined by Doclet
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    84
    public void init(Locale locale, Reporter reporter) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    85
        configuration.reporter = reporter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    86
        configuration.locale = locale;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
    87
        messages = configuration.getMessages();
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    88
    }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    89
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     * Create the configuration instance.
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     * Override this method to use a different
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     * configuration.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    94
     * @return the configuration for this doclet
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     */
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
    96
    @Override // defined by AbstractDoclet
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    97
    public ConfigurationImpl configuration() {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    98
        return configuration;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     * Start the generation of files. Call generate methods in the individual
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   103
     * writers, which will in turn generate the documentation files. Call the
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
     * TreeWriter generation first to ensure the Class Hierarchy is built
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
     * first and then can be used in the later generation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
     * For new format.
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
     *
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   109
     * @throws DocletException if there is a problem while writing the other files
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   110
     * @see jdk.doclet.DocletEnvironment
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     */
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
   112
    @Override // defined by AbstractDoclet
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 37009
diff changeset
   113
    protected void generateOtherFiles(DocletEnvironment docEnv, ClassTree classtree)
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   114
            throws DocletException {
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 37009
diff changeset
   115
        super.generateOtherFiles(docEnv, classtree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
        if (configuration.linksource) {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   117
            SourceToHTMLConverter.convertRoot(configuration,
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 37009
diff changeset
   118
                docEnv, DocPaths.SOURCE_OUTPUT);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   121
        if (configuration.topFile.isEmpty()) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
   122
            messages.error("doclet.No_Non_Deprecated_Classes_To_Document");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        boolean nodeprecated = configuration.nodeprecated;
14368
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
   126
        performCopy(configuration.helpfile);
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
   127
        performCopy(configuration.stylesheetfile);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
        // do early to reduce memory footprint
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        if (configuration.classuse) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
            ClassUseWriter.generate(configuration, classtree);
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
        IndexBuilder indexbuilder = new IndexBuilder(configuration, nodeprecated);
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
        if (configuration.createtree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
            TreeWriter.generate(configuration, classtree);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        if (configuration.createindex) {
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   138
            configuration.buildSearchTagIndex();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
            if (configuration.splitindex) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
                SplitIndexWriter.generate(configuration, indexbuilder);
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
                SingleIndexWriter.generate(configuration, indexbuilder);
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        if (!(configuration.nodeprecatedlist || nodeprecated)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
            DeprecatedListWriter.generate(configuration);
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        AllClassesFrameWriter.generate(configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
            new IndexBuilder(configuration, nodeprecated, true));
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   153
        if (configuration.frames) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   154
            FrameOutputWriter.generate(configuration);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   155
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        if (configuration.createoverview) {
39586
e35b6ab55e00 8157987: overview-summary.html generated by javadoc should include module information
bpatel
parents: 39364
diff changeset
   158
            if (configuration.showModules) {
e35b6ab55e00 8157987: overview-summary.html generated by javadoc should include module information
bpatel
parents: 39364
diff changeset
   159
                ModuleIndexWriter.generate(configuration);
e35b6ab55e00 8157987: overview-summary.html generated by javadoc should include module information
bpatel
parents: 39364
diff changeset
   160
            } else {
e35b6ab55e00 8157987: overview-summary.html generated by javadoc should include module information
bpatel
parents: 39364
diff changeset
   161
                PackageIndexWriter.generate(configuration);
e35b6ab55e00 8157987: overview-summary.html generated by javadoc should include module information
bpatel
parents: 39364
diff changeset
   162
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
        }
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   164
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   165
        if (!configuration.frames && !configuration.createoverview) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   166
            IndexRedirectWriter.generate(configuration);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   167
        }
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   168
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        if (configuration.helpfile.length() == 0 &&
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
            !configuration.nohelp) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
            HelpWriter.generate(configuration);
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
        }
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   173
        // If a stylesheet file is not specified, copy the default stylesheet
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   174
        // and replace newline with platform-specific newline.
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14542
diff changeset
   175
        DocFile f;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        if (configuration.stylesheetfile.length() == 0) {
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14542
diff changeset
   177
            f = DocFile.createFileForOutput(configuration, DocPaths.STYLESHEET);
14368
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
   178
            f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.STYLESHEET), false, true);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        }
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14542
diff changeset
   180
        f = DocFile.createFileForOutput(configuration, DocPaths.JAVASCRIPT);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14542
diff changeset
   181
        f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.JAVASCRIPT), true, true);
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   182
        if (configuration.createindex) {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   183
            f = DocFile.createFileForOutput(configuration, DocPaths.SEARCH_JS);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   184
            f.copyResource(DOCLET_RESOURCES.resolve(DocPaths.SEARCH_JS), true, true);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   185
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   186
            f = DocFile.createFileForOutput(configuration, DocPaths.RESOURCES.resolve(DocPaths.GLASS_IMG));
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   187
            f.copyResource(DOCLET_RESOURCES.resolve(DocPaths.GLASS_IMG), true, false);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   188
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   189
            f = DocFile.createFileForOutput(configuration, DocPaths.RESOURCES.resolve(DocPaths.X_IMG));
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   190
            f.copyResource(DOCLET_RESOURCES.resolve(DocPaths.X_IMG), true, false);
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   191
            copyJqueryFiles();
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   192
        }
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   193
    }
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   194
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   195
    protected void copyJqueryFiles() throws DocletException {
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   196
        List<String> files = Arrays.asList(
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   197
                "jquery-1.10.2.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   198
                "jquery-ui.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   199
                "jquery-ui.css",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   200
                "jquery-ui.min.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   201
                "jquery-ui.min.css",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   202
                "jquery-ui.structure.min.css",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   203
                "jquery-ui.structure.css",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   204
                "external/jquery/jquery.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   205
                "jszip/dist/jszip.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   206
                "jszip/dist/jszip.min.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   207
                "jszip-utils/dist/jszip-utils.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   208
                "jszip-utils/dist/jszip-utils.min.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   209
                "jszip-utils/dist/jszip-utils-ie.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   210
                "jszip-utils/dist/jszip-utils-ie.min.js",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   211
                "images/ui-bg_flat_0_aaaaaa_40x100.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   212
                "images/ui-icons_454545_256x240.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   213
                "images/ui-bg_glass_95_fef1ec_1x400.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   214
                "images/ui-bg_glass_75_dadada_1x400.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   215
                "images/ui-bg_highlight-soft_75_cccccc_1x100.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   216
                "images/ui-icons_888888_256x240.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   217
                "images/ui-icons_2e83ff_256x240.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   218
                "images/ui-bg_glass_65_ffffff_1x400.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   219
                "images/ui-icons_cd0a0a_256x240.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   220
                "images/ui-bg_glass_55_fbf9ee_1x400.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   221
                "images/ui-icons_222222_256x240.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   222
                "images/ui-bg_glass_75_e6e6e6_1x400.png",
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   223
                "images/ui-bg_flat_75_ffffff_40x100.png");
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   224
        DocFile f;
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   225
        for (String file : files) {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   226
            DocPath filePath = DocPaths.JQUERY_FILES.resolve(file);
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   227
            f = DocFile.createFileForOutput(configuration, filePath);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   228
            f.copyResource(DOCLET_RESOURCES.resolve(filePath), true, false);
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 26269
diff changeset
   229
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
     */
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
   235
    @Override // defined by AbstractDoclet
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   236
    protected void generateClassFiles(SortedSet<TypeElement> arr, ClassTree classtree)
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   237
            throws DocletException {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   238
        List<TypeElement> list = new ArrayList<>(arr);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   239
        ListIterator<TypeElement> iterator = list.listIterator();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   240
        TypeElement klass = null;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   241
        while (iterator.hasNext()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   242
            TypeElement prev = iterator.hasPrevious() ? klass : null;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   243
            klass = iterator.next();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   244
            TypeElement next = iterator.nextIndex() == list.size()
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   245
                    ? null : list.get(iterator.nextIndex());
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   246
37009
476d8d615222 8073100: [javadoc] Provide an ability to suppress document generation for specific elements.
ksrini
parents: 36526
diff changeset
   247
            if (utils.isHidden(klass) ||
476d8d615222 8073100: [javadoc] Provide an ability to suppress document generation for specific elements.
ksrini
parents: 36526
diff changeset
   248
                    !(configuration.isGeneratedDoc(klass) && utils.isIncluded(klass))) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
            }
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   251
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   252
            if (utils.isAnnotationType(klass)) {
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   253
                AbstractBuilder annotationTypeBuilder =
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   254
                    configuration.getBuilderFactory()
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   255
                        .getAnnotationTypeBuilder(klass,
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   256
                            prev == null ? null : prev.asType(),
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   257
                            next == null ? null : next.asType());
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   258
                annotationTypeBuilder.build();
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   259
            } else {
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   260
                AbstractBuilder classBuilder =
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   261
                    configuration.getBuilderFactory().getClassBuilder(klass,
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   262
                            prev, next, classtree);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   263
                classBuilder.build();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   268
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   269
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   270
     */
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
   271
    @Override // defined by AbstractDoclet
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   272
    protected void generateModuleFiles() throws DocletException {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   273
        if (configuration.showModules) {
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   274
            if (configuration.frames) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   275
                ModuleIndexFrameWriter.generate(configuration);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   276
            }
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   277
            ModuleElement prevModule = null, nextModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   278
            List<ModuleElement> mdles = new ArrayList<>(configuration.modulePackages.keySet());
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   279
            int i = 0;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   280
            for (ModuleElement mdle : mdles) {
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   281
                if (configuration.frames) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   282
                    ModulePackageIndexFrameWriter.generate(configuration, mdle);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   283
                    ModuleFrameWriter.generate(configuration, mdle);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   284
                }
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   285
                nextModule = (i + 1 < mdles.size()) ? mdles.get(i + 1) : null;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   286
                AbstractBuilder moduleSummaryBuilder =
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   287
                        configuration.getBuilderFactory().getModuleSummaryBuilder(
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   288
                        mdle, prevModule, nextModule);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   289
                moduleSummaryBuilder.build();
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   290
                prevModule = mdle;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   291
                i++;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   292
            }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   293
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   294
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   295
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   296
    PackageElement getNamedPackage(List<PackageElement> list, int idx) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   297
        if (idx < list.size()) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   298
            PackageElement pkg = list.get(idx);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   299
            if (pkg != null && !pkg.isUnnamed()) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   300
                return pkg;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   301
            }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   302
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   303
        return null;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   304
    }
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 22447
diff changeset
   305
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   306
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   307
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   308
     */
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
   309
    @Override // defined by AbstractDoclet
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   310
    protected void generatePackageFiles(ClassTree classtree) throws DocletException {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   311
        Set<PackageElement> packages = configuration.packages;
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   312
        if (packages.size() > 1 && configuration.frames) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
            PackageIndexFrameWriter.generate(configuration);
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
        }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   315
        List<PackageElement> pList = new ArrayList<>(packages);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   316
        PackageElement prev = null;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   317
        for (int i = 0 ; i < pList.size() ; i++) {
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   318
            // if -nodeprecated option is set and the package is marked as
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   319
            // deprecated, do not generate the package-summary.html, package-frame.html
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   320
            // and package-tree.html pages for that package.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   321
            PackageElement pkg = pList.get(i);
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24221
diff changeset
   322
            if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) {
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   323
                if (configuration.frames) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   324
                    PackageFrameWriter.generate(configuration, pkg);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40315
diff changeset
   325
                }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   326
                int nexti = i + 1;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   327
                PackageElement next = null;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   328
                if (nexti < pList.size()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   329
                    next = pList.get(nexti);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   330
                    // If the next package is unnamed package, skip 2 ahead if possible
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   331
                    if (next.isUnnamed() && ++nexti < pList.size()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   332
                       next = pList.get(nexti);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   333
                    }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   334
                }
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   335
                AbstractBuilder packageSummaryBuilder =
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   336
                        configuration.getBuilderFactory().getPackageSummaryBuilder(
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 22447
diff changeset
   337
                        pkg, prev, next);
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   338
                packageSummaryBuilder.build();
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   339
                if (configuration.createtree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   340
                    PackageTreeWriter.generate(configuration, pkg, prev, next,
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   341
                            configuration.nodeprecated);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 7681
diff changeset
   342
                }
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 22447
diff changeset
   343
                prev = pkg;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
40315
9e994c77db6a 8160137: HTMLDoclet and AbstractDoclet should implement Doclet
jjg
parents: 40303
diff changeset
   348
    @Override // defined by Doclet
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   349
    public Set<Option> getSupportedOptions() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   350
        return configuration.getSupportedOptions();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   353
    private void performCopy(String filename) throws DocFileIOException {
14368
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
   354
        if (filename.isEmpty())
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
   355
            return;
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
   356
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   357
        DocFile fromfile = DocFile.createFileForInput(configuration, filename);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   358
        DocPath path = DocPath.create(fromfile.getName());
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   359
        DocFile toFile = DocFile.createFileForOutput(configuration, path);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   360
        if (toFile.isSameFile(fromfile))
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   361
            return;
14368
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14357
diff changeset
   362
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   363
        messages.notice("doclet.Copying_File_0_To_File_1",
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   364
                fromfile.toString(), path.getPath());
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
   365
        toFile.copyFile(fromfile);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
}