1 4 package com.tc.aspectwerkz.reflect.impl.asm; 5 6 import com.tc.aspectwerkz.reflect.MemberInfo; 7 import com.tc.aspectwerkz.reflect.ClassInfo; 8 9 import java.lang.ref.WeakReference ; 10 11 16 public abstract class AsmMemberInfo implements MemberInfo { 17 18 21 protected final MemberStruct m_member; 22 23 26 protected final WeakReference m_loaderRef; 27 28 31 protected final String m_declaringTypeName; 32 33 36 protected ClassInfo m_declaringType; 37 38 41 43 50 AsmMemberInfo(final MemberStruct member, final String declaringType, final ClassLoader loader) { 51 if (member == null) { 52 throw new IllegalArgumentException ("member can not be null"); 53 } 54 if (declaringType == null) { 55 throw new IllegalArgumentException ("declaring type can not be null"); 56 } 57 m_member = member; 58 m_loaderRef = new WeakReference (loader); 59 m_declaringTypeName = declaringType.replace('/', '.'); 60 } 62 63 68 public String getName() { 69 return m_member.name; 70 } 71 72 77 public int getModifiers() { 78 return m_member.modifiers; 79 } 80 81 86 public ClassInfo getDeclaringType() { 87 if (m_declaringType == null) { 88 m_declaringType = AsmClassInfo.getClassInfo(m_declaringTypeName, (ClassLoader ) m_loaderRef.get()); 90 } 91 return m_declaringType; 92 } 93 } | Popular Tags |