1 4 package com.tc.aspectwerkz.transform.inlining; 5 6 import com.tc.aspectwerkz.aspect.AdviceInfo; 7 8 14 public class AdviceMethodInfo { 15 private final AspectInfo m_aspectInfo; 16 private final AdviceInfo m_adviceInfo; 17 private int m_specialArgumentIndex = -1; 18 private String m_calleeClassSignature; 19 private String m_callerClassSignature; 20 private String m_joinPointClassName; 21 private String m_calleeMemberDesc; 22 23 public AdviceMethodInfo(final AspectInfo aspectInfo, 24 final AdviceInfo adviceInfo, 25 final String callerClassSignature, 26 final String calleeClassSignature, 27 final String joinPointClassName, 28 final String calleeMemberDesc) { 29 m_aspectInfo = aspectInfo; 30 m_adviceInfo = adviceInfo; 31 m_callerClassSignature = callerClassSignature; 32 m_calleeClassSignature = calleeClassSignature; 33 m_joinPointClassName = joinPointClassName; 34 m_calleeMemberDesc = calleeMemberDesc; 35 } 36 37 public AdviceInfo getAdviceInfo() { 38 return m_adviceInfo; 39 } 40 41 public AspectInfo getAspectInfo() { 42 return m_aspectInfo; 43 } 44 45 public int[] getAdviceMethodArgIndexes() { 46 return m_adviceInfo.getMethodToArgIndexes(); 47 } 48 49 public String getSpecialArgumentTypeDesc() { 50 return m_adviceInfo.getSpecialArgumentTypeDesc(); 51 } 52 53 public String getSpecialArgumentTypeName() { 54 return m_adviceInfo.getSpecialArgumentTypeName(); 55 } 56 57 public int getSpecialArgumentIndex() { 58 return m_specialArgumentIndex; 59 } 60 61 public void setSpecialArgumentIndex(final int index) { 62 m_specialArgumentIndex = index; 63 } 64 65 public String getCalleeClassSignature() { 66 return m_calleeClassSignature; 67 } 68 69 public String getCallerClassSignature() { 70 return m_callerClassSignature; 71 } 72 73 public String getJoinPointClassName() { 74 return m_joinPointClassName; 75 } 76 77 public String getCalleeMemberDesc() { 78 return m_calleeMemberDesc; 79 } 80 81 84 public boolean requiresThisOrTarget() { 85 if (m_adviceInfo.hasTargetWithRuntimeCheck()) { 86 return true; 87 } else { 88 for (int i = 0; i < m_adviceInfo.getMethodToArgIndexes().length; i++) { 90 int index = m_adviceInfo.getMethodToArgIndexes()[i]; 91 if (index == AdviceInfo.TARGET_ARG || 92 index == AdviceInfo.THIS_ARG) { 93 return true; 94 } 95 } 96 } 97 return false; 98 } 99 100 103 public boolean requiresJoinPoint() { 104 for (int i = 0; i < m_adviceInfo.getMethodToArgIndexes().length; i++) { 106 int index = m_adviceInfo.getMethodToArgIndexes()[i]; 107 if (index == AdviceInfo.JOINPOINT_ARG) { 108 return true; 109 } 110 } 111 return false; 112 } 113 114 } 115 | Popular Tags |