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.

DeprecatedAPIListBuilder.java 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.ajdoc.AspectDoc;
  24. import org.aspectj.ajdoc.IntroducedDoc;
  25. import org.aspectj.ajdoc.IntroductionDoc;
  26. import org.aspectj.tools.ajdoc.Util;
  27. import com.sun.javadoc.ClassDoc;
  28. import com.sun.javadoc.MemberDoc;
  29. import com.sun.javadoc.RootDoc;
  30. import java.util.ArrayList;
  31. import java.util.Collections;
  32. import java.util.List;
  33. public class DeprecatedAPIListBuilder
  34. extends com.sun.tools.doclets.standard.DeprecatedAPIListBuilder
  35. {
  36. private List deprecatedadvice = new ArrayList();
  37. private List deprecatedpointcuts = new ArrayList();
  38. private List deprecatedfieldintroductions = new ArrayList();
  39. private List deprecatedmethodintroductions = new ArrayList();
  40. private List deprecatedconstructorintroductions = new ArrayList();
  41. private List deprecatedsuperintroductions = new ArrayList();
  42. public DeprecatedAPIListBuilder(RootDoc root) {
  43. super(root);
  44. buildDeprecatedAPIInfo(root);
  45. }
  46. protected void buildDeprecatedAPIInfo(RootDoc root) {
  47. ClassDoc[] cs = root.classes();
  48. for (int i = 0; i < cs.length; i++) {
  49. org.aspectj.ajdoc.ClassDoc c = (org.aspectj.ajdoc.ClassDoc)cs[i];
  50. _composeDeprecatedList(deprecatedpointcuts, c.pointcuts());
  51. if (c instanceof AspectDoc) {
  52. AspectDoc ad = (AspectDoc)c;
  53. _composeDeprecatedList(deprecatedadvice, ad.advice());
  54. IntroductionDoc[] intros = ad.introductions();
  55. for (int j = 0; j < intros.length; j++) {
  56. if (intros[j] instanceof IntroducedDoc) {
  57. MemberDoc md = ((IntroducedDoc)intros[j]).member();
  58. if (md == null) continue;
  59. if (md.isField()) {
  60. _composeDeprecatedList(deprecatedfieldintroductions,
  61. intros[j]);
  62. } else if (md.isMethod()) {
  63. _composeDeprecatedList(deprecatedmethodintroductions,
  64. intros[j]);
  65. } else {
  66. _composeDeprecatedList(deprecatedconstructorintroductions,
  67. intros[j]);
  68. }
  69. } else {
  70. _composeDeprecatedList(deprecatedsuperintroductions,
  71. intros[j]);
  72. }
  73. }
  74. }
  75. }
  76. Collections.sort(deprecatedadvice);
  77. Collections.sort(deprecatedpointcuts);
  78. Collections.sort(deprecatedfieldintroductions);
  79. Collections.sort(deprecatedmethodintroductions);
  80. Collections.sort(deprecatedconstructorintroductions);
  81. Collections.sort(deprecatedsuperintroductions);
  82. }
  83. protected void _composeDeprecatedList(List list, MemberDoc member) {
  84. _composeDeprecatedList(list, new MemberDoc[]{member});
  85. }
  86. protected void _composeDeprecatedList(List list, MemberDoc[] members) {
  87. Util.invoke(com.sun.tools.doclets.standard.DeprecatedAPIListBuilder.class,
  88. this, "composeDeprecatedList",
  89. new Class[]{java.util.List.class,
  90. com.sun.javadoc.MemberDoc[].class},
  91. new Object[]{list, members});
  92. }
  93. public List getDeprecatedAdivce() {
  94. return deprecatedadvice;
  95. }
  96. public List getDeprecatedPointcuts() {
  97. return deprecatedpointcuts;
  98. }
  99. public List getDeprecatedFieldIntroductions() {
  100. return deprecatedfieldintroductions;
  101. }
  102. public List getDeprecatedMethodIntroductions() {
  103. return deprecatedmethodintroductions;
  104. }
  105. public List getDeprecatedConstructorIntroductions() {
  106. return deprecatedconstructorintroductions;
  107. }
  108. public List getDeprecatedSuperIntroductions() {
  109. return deprecatedsuperintroductions;
  110. }
  111. }