1 22 package org.aspectj.tools.ajdoc; 23 24 import org.aspectj.ajdoc.AspectDoc; 25 import org.aspectj.ajdoc.ClassDoc; 26 import org.aspectj.ajdoc.IntroductionDoc; 27 import org.aspectj.compiler.crosscuts.ast.IntroducedDec; 28 import org.aspectj.compiler.crosscuts.ast.IntroducedSuperDec; 29 30 import java.util.ArrayList ; 31 import java.util.Collection ; 32 33 public abstract class IntroductionDocImpl 34 extends MemberDocImpl 35 implements IntroductionDoc { 36 37 38 public static IntroductionDocImpl getInstance(AspectDoc ad, Object o) { 39 return factory.getInstance(ad, o); 40 } 41 42 43 private final static Factory factory = new Factory(); 44 45 private final Collection targets = new ArrayList (); 46 47 public void addTarget(ClassDoc cd) { targets.add(cd); } 48 49 protected IntroductionDocImpl(com.sun.javadoc.ClassDoc containingClass) { 50 super(containingClass); 51 } 52 53 55 61 public final ClassDoc[] targets() { 62 return (ClassDoc[])targets.toArray(new ClassDoc[targets.size()]); 64 } 65 66 70 private final static class Factory { 71 public static IntroductionDocImpl getInstance(AspectDoc ad, Object o) { 72 if (o instanceof IntroducedSuperDec) { 73 return new IntroducedSuperDocImpl(ad, (IntroducedSuperDec)o); 74 } 75 if (o instanceof IntroducedDec) { 76 return new IntroducedDocImpl(ad, (IntroducedDec)o); 77 } 78 return null; 79 } 80 } 81 82 83 public boolean weakEquals(Object md) { 84 return false; } 86 } 87 | Popular Tags |