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.

DeprecatedListWriter.java 3.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 org.aspectj.tools.ajdoc.Access;
  24. import com.sun.javadoc.RootDoc;
  25. import com.sun.tools.doclets.DocletAbortException;
  26. import java.io.IOException;
  27. import java.util.List;
  28. public class DeprecatedListWriter
  29. extends com.sun.tools.doclets.standard.DeprecatedListWriter
  30. {
  31. protected DeprecatedAPIListBuilder builder;
  32. public DeprecatedListWriter(String filename,
  33. DeprecatedAPIListBuilder builder)
  34. throws IOException {
  35. super(filename);
  36. this.builder = builder;
  37. }
  38. public static void generate(RootDoc root) throws DocletAbortException {
  39. String filename = "deprecated-list.html";
  40. DeprecatedListWriter dw = null;
  41. try {
  42. (dw = new DeprecatedListWriter(filename,
  43. new DeprecatedAPIListBuilder(root))).
  44. generateDeprecatedListFile();
  45. } catch (IOException e) {
  46. Standard.configuration().
  47. standardmessage.error("doclet.exception_encountered",
  48. e+"", filename);
  49. throw new DocletAbortException();
  50. } finally {
  51. if (dw != null) dw.close();
  52. }
  53. }
  54. protected void generateDeprecatedListFile() throws IOException {
  55. generateDeprecatedListFile(builder);
  56. }
  57. protected void printDeprecatedFooter() {
  58. printRestOfDeprecatedListFile();
  59. super.printDeprecatedFooter();
  60. }
  61. protected void printRestOfDeprecatedListFile() {
  62. deprecatedListFile(new AdviceSubWriter(this),
  63. builder.getDeprecatedAdivce());
  64. deprecatedListFile(new PointcutSubWriter(this),
  65. builder.getDeprecatedPointcuts());
  66. deprecatedListFile(new FieldIntroductionSubWriter(this),
  67. builder.getDeprecatedFieldIntroductions());
  68. deprecatedListFile(new MethodIntroductionSubWriter(this),
  69. builder.getDeprecatedMethodIntroductions());
  70. deprecatedListFile(new ConstructorIntroductionSubWriter(this),
  71. builder.getDeprecatedConstructorIntroductions());
  72. deprecatedListFile(new SuperIntroductionSubWriter(this),
  73. builder.getDeprecatedSuperIntroductions());
  74. }
  75. protected final void deprecatedListFile(AbstractSubWriter mw,
  76. List list) {
  77. Access.printDeprecatedAPI(mw, list,
  78. "doclet.Deprecated_" +
  79. mw.keyName() + "s");
  80. }
  81. }