1 8 package org.codehaus.aspectwerkz.reflect.impl.asm; 9 10 import org.codehaus.aspectwerkz.annotation.instrumentation.asm.CustomAttribute; 11 import org.codehaus.aspectwerkz.annotation.instrumentation.asm.CustomAttributeHelper; 12 import org.codehaus.aspectwerkz.annotation.AnnotationInfo; 13 import org.codehaus.aspectwerkz.reflect.ClassInfo; 14 import org.codehaus.aspectwerkz.reflect.MemberInfo; 15 import org.codehaus.aspectwerkz.transform.inlining.AsmHelper; 16 import org.objectweb.asm.Attribute; 17 import org.objectweb.asm.attrs.RuntimeInvisibleAnnotations; 18 import org.objectweb.asm.attrs.Annotation; 19 import org.objectweb.asm.attrs.RuntimeVisibleAnnotations; 20 21 import java.lang.ref.WeakReference ; 22 import java.util.*; 23 24 29 public abstract class AsmMemberInfo implements MemberInfo { 30 31 34 protected final MemberStruct m_member; 35 36 39 protected final WeakReference m_loaderRef; 40 41 44 protected final String m_declaringTypeName; 45 46 49 protected ClassInfo m_declaringType; 50 51 54 protected List m_annotations = null; 55 56 59 protected final AsmClassInfoRepository m_classInfoRepository; 60 61 68 AsmMemberInfo(final MemberStruct member, final String declaringType, final ClassLoader loader) { 69 if (member == null) { 70 throw new IllegalArgumentException ("member can not be null"); 71 } 72 if (declaringType == null) { 73 throw new IllegalArgumentException ("declaring type can not be null"); 74 } 75 m_member = member; 76 m_loaderRef = new WeakReference (loader); 77 m_declaringTypeName = declaringType.replace('/', '.'); 78 m_classInfoRepository = AsmClassInfoRepository.getRepository(loader); 79 } 80 81 86 public String getName() { 87 return m_member.name; 88 } 89 90 95 public int getModifiers() { 96 return m_member.modifiers; 97 } 98 99 104 public ClassInfo getDeclaringType() { 105 if (m_declaringType == null) { 106 m_declaringType = m_classInfoRepository.getClassInfo(m_declaringTypeName); 107 } 108 return m_declaringType; 109 } 110 } | Popular Tags |