1 12 package org.aspectj.internal.lang.reflect; 13 14 import org.aspectj.lang.reflect.AjType; 15 import org.aspectj.lang.reflect.InterTypeDeclaration; 16 17 21 public class InterTypeDeclarationImpl implements InterTypeDeclaration { 22 23 private AjType<?> declaringType; 24 protected String targetTypeName; 25 private AjType<?> targetType; 26 private int modifiers; 27 28 public InterTypeDeclarationImpl(AjType<?> decType, String target, int mods) { 29 this.declaringType = decType; 30 this.targetTypeName = target; 31 this.modifiers = mods; 32 try { 33 this.targetType = (AjType<?>) StringToType.stringToType(target, decType.getJavaClass()); 34 } catch (ClassNotFoundException cnf) { 35 } 37 } 38 39 public InterTypeDeclarationImpl(AjType<?> decType, AjType<?> targetType, int mods) { 40 this.declaringType = decType; 41 this.targetType = targetType; 42 this.targetTypeName = targetType.getName(); 43 this.modifiers = mods; 44 } 45 46 49 public AjType<?> getDeclaringType() { 50 return this.declaringType; 51 } 52 53 56 public AjType<?> getTargetType() throws ClassNotFoundException { 57 if (this.targetType == null) throw new ClassNotFoundException (this.targetTypeName); 58 return this.targetType; 59 } 60 61 64 public int getModifiers() { 65 return this.modifiers; 66 } 67 68 } 69 | Popular Tags |