langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/PackageListWriter.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
28 import java.io.*; |
28 import java.io.*; |
29 |
29 |
30 import javax.lang.model.element.PackageElement; |
30 import javax.lang.model.element.PackageElement; |
31 |
31 |
32 import jdk.javadoc.doclet.DocletEnvironment; |
32 import jdk.javadoc.doclet.DocletEnvironment; |
33 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
33 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; |
34 |
34 |
35 |
35 |
36 /** |
36 /** |
37 * Write out the package index. |
37 * Write out the package index. |
38 * |
38 * |
43 * |
43 * |
44 * @author Atul M Dambalkar |
44 * @author Atul M Dambalkar |
45 */ |
45 */ |
46 public class PackageListWriter { |
46 public class PackageListWriter { |
47 |
47 |
48 private final Configuration configuration; |
48 private final BaseConfiguration configuration; |
49 private final Utils utils; |
49 private final Utils utils; |
50 private final DocFile file; |
50 private final DocFile file; |
51 |
51 |
52 /** |
52 /** |
53 * Constructor. |
53 * Constructor. |
54 * |
54 * |
55 * @param configuration the current configuration of the doclet. |
55 * @param configuration the current configuration of the doclet. |
56 */ |
56 */ |
57 public PackageListWriter(Configuration configuration) { |
57 public PackageListWriter(BaseConfiguration configuration) { |
58 file = DocFile.createFileForOutput(configuration, DocPaths.PACKAGE_LIST); |
58 file = DocFile.createFileForOutput(configuration, DocPaths.PACKAGE_LIST); |
59 this.configuration = configuration; |
59 this.configuration = configuration; |
60 this.utils = configuration.utils; |
60 this.utils = configuration.utils; |
61 } |
61 } |
62 |
62 |
64 * Generate the package index. |
64 * Generate the package index. |
65 * |
65 * |
66 * @param configuration the current configuration of the doclet. |
66 * @param configuration the current configuration of the doclet. |
67 * @throws DocFileIOException if there is a problem writing the output |
67 * @throws DocFileIOException if there is a problem writing the output |
68 */ |
68 */ |
69 public static void generate(Configuration configuration) throws DocFileIOException { |
69 public static void generate(BaseConfiguration configuration) throws DocFileIOException { |
70 PackageListWriter packgen = new PackageListWriter(configuration); |
70 PackageListWriter packgen = new PackageListWriter(configuration); |
71 packgen.generatePackageListFile(configuration.docEnv); |
71 packgen.generatePackageListFile(configuration.docEnv); |
72 } |
72 } |
73 |
73 |
74 protected void generatePackageListFile(DocletEnvironment docEnv) throws DocFileIOException { |
74 protected void generatePackageListFile(DocletEnvironment docEnv) throws DocFileIOException { |