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.

PackageFrameWriter.java 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 PackageFrameWriter
  28. extends com.sun.tools.doclets.standard.PackageFrameWriter
  29. {
  30. protected final PackageDoc packagedoc;
  31. public PackageFrameWriter(String path,
  32. String filename,
  33. PackageDoc packagedoc)
  34. throws IOException, DocletAbortException {
  35. super(path, filename, packagedoc);
  36. this.packagedoc = packagedoc;
  37. }
  38. public static void generate(PackageDoc pkg) throws DocletAbortException {
  39. PackageFrameWriter pw = null;
  40. String path = DirectoryManager.getDirectoryPath(pkg);
  41. String filename = "package-frame" + ".html";
  42. try {
  43. (pw = new PackageFrameWriter(path, filename, pkg)).
  44. generatePackageFile();
  45. } catch (IOException e) {
  46. Standard.configuration().standardmessage.
  47. error("doclet.exception_encountered",
  48. e+"", filename);
  49. throw new DocletAbortException();
  50. } finally {
  51. if (pw != null) pw.close();
  52. }
  53. }
  54. protected void generateClassListing() {
  55. generateClassKindListing(packagedoc.interfaces(),
  56. getText("doclet.Interfaces"));
  57. generateClassKindListing(Statics.classes(packagedoc.
  58. ordinaryClasses()),
  59. getText("doclet.Classes"));
  60. generateClassKindListing(((org.aspectj.ajdoc.PackageDoc)packagedoc).
  61. aspects(),
  62. getText("doclet.Aspects"));
  63. generateClassKindListing(packagedoc.exceptions(),
  64. getText("doclet.Exceptions"));
  65. generateClassKindListing(packagedoc.errors(),
  66. getText("doclet.Errors"));
  67. }
  68. }