1 22 package org.aspectj.tools.ajdoc; 23 24 import org.aspectj.ajdoc.ClassDoc; 25 import org.aspectj.ajdoc.PointcutDoc; 26 import org.aspectj.compiler.base.ast.Dec; 27 import org.aspectj.compiler.base.ast.Formals; 28 import org.aspectj.compiler.base.ast.NameType; 29 import org.aspectj.compiler.base.ast.TypeD; 30 import org.aspectj.compiler.base.ast.TypeDec; 31 import org.aspectj.compiler.base.ast.TypeDs; 32 import org.aspectj.compiler.crosscuts.ast.PointcutDec; 33 34 import java.util.Collection ; 35 import java.util.Collections ; 36 37 public class PointcutDocImpl 38 extends ExecutableMemberDocImpl 39 implements PointcutDoc { 40 41 42 private final PointcutDec pointcutDec; 43 44 public PointcutDocImpl(ClassDoc containingClass, PointcutDec pointcutDec) { 45 super(containingClass); 46 this.pointcutDec = pointcutDec; 47 } 48 49 55 protected Collection createAdvice() { 56 return Collections.EMPTY_LIST; 57 } 58 59 64 protected Dec dec() { 65 return pointcutDec; 66 } 67 68 73 protected Formals getFormals() { 74 return pointcutDec.getFormals(); 75 } 76 77 82 public TypeDs getThrows() { 83 return null; 84 } 85 86 92 public com.sun.javadoc.Type resultType() { 93 TypeD typed = pointcutDec.getResultTypeD(); 94 if (typed == null) return null; return null; } 97 98 105 public com.sun.javadoc.ClassDoc overriddenClass() { 106 TypeDec where = pointcutDec.getDeclaringType().getTypeDec(); 108 NameType superType = (NameType)where.getSuperClassType(); 109 while (superType != null) { 110 PointcutDec pc = Util.pointcutDec(superType, 111 pointcutDec.getId(), 112 pointcutDec.getFormals()); 113 if (pc != null && !pc.getId().equals("NOT_FOUND")) { 114 return null; } 117 if (superType.getTypeDec().getFullName(). 118 equals("java.lang.Object")) { 119 return null; 120 } 121 superType = (NameType)superType.getTypeDec().getSuperClassType(); 122 } 123 return null; 124 } 125 126 131 public boolean isPointcut() { 132 return true; 133 } 134 135 140 public boolean isAbstract() { 141 return pointcutDec.isAbstract(); 142 } 143 } 144 | Popular Tags |