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