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.

SingleIndexWriter.java 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.MemberDoc;
  24. import com.sun.javadoc.ClassDoc;
  25. import com.sun.tools.doclets.DocletAbortException;
  26. import com.sun.tools.doclets.IndexBuilder;
  27. import java.io.IOException;
  28. public class SingleIndexWriter
  29. extends com.sun.tools.doclets.standard.SingleIndexWriter
  30. {
  31. protected class Del extends AbstractIndexWriter {
  32. public Del(String s, IndexBuilder i) throws IOException {
  33. super(s, i);
  34. }
  35. public void print(String s) {
  36. SingleIndexWriter.this.print(s);
  37. }
  38. }
  39. final protected Del del;
  40. {
  41. Standard.quiet();
  42. Del d = null;
  43. try {
  44. d = new Del(filename, indexbuilder);
  45. } catch (Exception e) {
  46. Standard.configuration().standardmessage.
  47. error("doclet.exception_encountered",
  48. e+"", filename);
  49. } finally {
  50. del = d;
  51. Standard.speak();
  52. }
  53. }
  54. protected void printMemberDesc(MemberDoc member) {
  55. del.printMemberDesc(member);
  56. }
  57. protected void printClassInfo(ClassDoc cd) {
  58. del.printClassInfo(cd);
  59. }
  60. public SingleIndexWriter(String filename,
  61. IndexBuilder indexbuilder) throws IOException {
  62. super(filename, indexbuilder);
  63. }
  64. public static void generate(IndexBuilder indexbuilder)
  65. throws DocletAbortException {
  66. SingleIndexWriter sw = null;
  67. String filename = "index-all.html";
  68. try {
  69. (sw = new SingleIndexWriter(filename, indexbuilder)).
  70. generateIndexFile();
  71. } catch (IOException e) {
  72. Standard.configuration().standardmessage.error
  73. ("doclet.exception_encountered",
  74. e+"", filename);
  75. throw new DocletAbortException();
  76. } finally {
  77. if (sw != null) sw.close();
  78. }
  79. }
  80. }