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.

PackageWriter.java 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.PackageDoc;
  24. import com.sun.tools.doclets.DirectoryManager;
  25. import com.sun.tools.doclets.DocletAbortException;
  26. import java.io.IOException;
  27. public class PackageWriter
  28. extends com.sun.tools.doclets.standard.PackageWriter
  29. {
  30. protected final PackageDoc packagedoc;
  31. public PackageWriter(String path,
  32. String filename,
  33. PackageDoc packagedoc,
  34. PackageDoc prev,
  35. PackageDoc next)
  36. throws IOException, DocletAbortException {
  37. super(path, filename, packagedoc, prev, next);
  38. this.packagedoc = packagedoc;
  39. }
  40. public static void generate(PackageDoc pkg,
  41. PackageDoc prev,
  42. PackageDoc next) throws DocletAbortException {
  43. PackageWriter pw;
  44. String path = DirectoryManager.getDirectoryPath(pkg);
  45. String filename = "package-summary.html";
  46. try {
  47. (pw = new PackageWriter(path, filename, pkg, prev, next)).
  48. generatePackageFile();
  49. pw.close();
  50. pw.copyDocFiles(path);
  51. } catch (IOException e) {
  52. Standard.configuration().standardmessage.
  53. error("doclet.exception_encountered", e+"", filename);
  54. throw new DocletAbortException();
  55. }
  56. }
  57. protected void generateClassListing() {
  58. generateClassKindListing(packagedoc.interfaces(),
  59. getText("doclet.Interface_Summary"));
  60. generateClassKindListing(Statics.classes(packagedoc.ordinaryClasses()),
  61. getText("doclet.Class_Summary"));
  62. generateClassKindListing(((org.aspectj.ajdoc.PackageDoc)packagedoc).aspects(),
  63. getText("doclet.Aspect_Summary"));
  64. generateClassKindListing(packagedoc.exceptions(),
  65. getText("doclet.Exception_Summary"));
  66. generateClassKindListing(packagedoc.errors(),
  67. getText("doclet.Error_Summary"));
  68. }
  69. }