You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PackageTreeWriter.java 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * This file is part of the debugger and core tools for the AspectJ(tm)
  4. * programming language; see http://aspectj.org
  5. *
  6. * The contents of this file are subject to the Mozilla Public License
  7. * Version 1.1 (the "License"); you may not use this file except in
  8. * compliance with the License. You may obtain a copy of the License at
  9. * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. *
  16. * The Original Code is AspectJ.
  17. *
  18. * The Initial Developer of the Original Code is Xerox Corporation. Portions
  19. * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
  20. * All Rights Reserved.
  21. */
  22. package org.aspectj.tools.doclets.standard;
  23. import com.sun.javadoc.ClassDoc;
  24. import com.sun.javadoc.PackageDoc;
  25. import com.sun.tools.doclets.ClassTree;
  26. import com.sun.tools.doclets.DirectoryManager;
  27. import com.sun.tools.doclets.DocletAbortException;
  28. import java.io.IOException;
  29. import java.util.List;
  30. public class PackageTreeWriter
  31. extends com.sun.tools.doclets.standard.PackageTreeWriter
  32. {
  33. protected class Del extends AbstractTreeWriter {
  34. public Del(String s, ClassTree c)
  35. throws IOException, DocletAbortException {
  36. super(s, c);
  37. }
  38. public void print(String s) {
  39. PackageTreeWriter.this.print(s);
  40. }
  41. }
  42. final protected Del del;
  43. {
  44. Standard.quiet();
  45. Del d = null;
  46. try {
  47. d = new Del(filename, classtree);
  48. } catch (Exception e) {
  49. Standard.configuration().standardmessage.
  50. error("doclet.exception_encountered",
  51. e+"", filename);
  52. } finally {
  53. del = d;
  54. Standard.speak();
  55. }
  56. }
  57. protected void generateLevelInfo(ClassDoc parent, List list) {
  58. del.generateLevelInfo(parent, list);
  59. }
  60. protected void generateTree(List list, String heading) {
  61. del.generateTree(list, heading);
  62. }
  63. public PackageTreeWriter(String path,
  64. String filename,
  65. PackageDoc packagedoc,
  66. PackageDoc prev,
  67. PackageDoc next,
  68. boolean noDeprecated)
  69. throws IOException, DocletAbortException {
  70. super(path, filename, packagedoc, prev, next, noDeprecated);
  71. }
  72. public static void generate(PackageDoc pkg, PackageDoc prev,
  73. PackageDoc next, boolean noDeprecated)
  74. throws DocletAbortException {
  75. PackageTreeWriter pw = null;
  76. String path = DirectoryManager.getDirectoryPath(pkg);
  77. String filename = "package-tree.html";
  78. try {
  79. (pw = new PackageTreeWriter(path, filename, pkg,
  80. prev, next, noDeprecated)).
  81. generatePackageTreeFile();
  82. } catch (IOException e) {
  83. Standard.configuration().standardmessage.
  84. error("doclet.exception_encountered",
  85. e+"", filename);
  86. throw new DocletAbortException();
  87. } finally {
  88. if (pw != null) pw.close();
  89. }
  90. }
  91. }