1 4 package com.tc.aspectwerkz.aspect; 5 6 import com.tc.asm.Type; 7 8 import com.tc.aspectwerkz.DeploymentModel; 9 import com.tc.aspectwerkz.expression.ExpressionInfo; 10 import com.tc.aspectwerkz.expression.ExpressionContext; 11 import com.tc.aspectwerkz.definition.AdviceDefinition; 12 import com.tc.aspectwerkz.transform.inlining.AsmHelper; 13 14 import java.io.Serializable ; 15 16 23 public class AdviceInfo implements Serializable { 24 25 public final static AdviceInfo[] EMPTY_ADVICE_INFO_ARRAY = new AdviceInfo[0]; 26 27 public final static int JOINPOINT_ARG = -0x1; 30 public final static int STATIC_JOINPOINT_ARG = -0x2; 31 public final static int TARGET_ARG = -0x3; 32 public final static int THIS_ARG = -0x4; 33 public final static int VALID_NON_AW_AROUND_CLOSURE_TYPE = -0x5; 34 public final static int SPECIAL_ARGUMENT = -0x6; 35 public static final int CUSTOM_JOIN_POINT_ARG = -0x7; 36 37 40 private String m_methodName; 41 42 45 private String m_methodSignature; 46 47 50 private Type[] m_methodParameterTypes; 51 52 56 private final String m_name; 57 58 61 private String m_aspectClassName; 62 63 66 private String m_aspectQualifiedName; 67 68 71 private DeploymentModel m_aspectDeploymentModel; 72 73 78 private int[] m_methodToArgIndexes; 79 80 83 private String m_specialArgumentTypeDesc; 84 85 88 private String m_specialArgumentTypeName; 89 90 93 private AdviceType m_type; 94 95 98 private boolean m_targetWithRuntimeCheck; 99 100 103 private ExpressionInfo m_expressionInfo; 104 105 108 private ExpressionContext m_expressionContext; 109 110 113 private AdviceDefinition m_adviceDef; 114 115 134 public AdviceInfo(final String aspectQualifiedName, 135 final String aspectClassName, 136 final DeploymentModel aspectDeploymentModel, 137 final String methodName, 138 final String methodSignature, 139 final Type[] methodParameterTypes, 140 final AdviceType type, 141 final String specialArgumentType, 142 final String adviceName, 143 final boolean targetWithRuntimeCheck, 144 final ExpressionInfo expressionInfo, 145 final ExpressionContext expressionContext, 146 final AdviceDefinition adviceDef) { 147 m_aspectQualifiedName = aspectQualifiedName; 148 m_aspectClassName = aspectClassName; 149 m_aspectDeploymentModel = aspectDeploymentModel; 150 m_methodName = methodName; 151 m_methodSignature = methodSignature; 152 m_methodParameterTypes = methodParameterTypes; 153 m_type = type; 154 if (specialArgumentType != null && specialArgumentType.length() > 0) { m_specialArgumentTypeDesc = AsmHelper.convertReflectDescToTypeDesc(specialArgumentType); 156 m_specialArgumentTypeName = specialArgumentType.replace('.', '/'); 157 } 158 m_name = adviceName; 159 m_targetWithRuntimeCheck = targetWithRuntimeCheck; 160 m_expressionInfo = expressionInfo; 161 m_expressionContext = expressionContext; 162 m_adviceDef = adviceDef; 163 } 164 165 170 public String getMethodName() { 171 return m_methodName; 172 } 173 174 179 public String getMethodSignature() { 180 return m_methodSignature; 181 } 182 183 188 public Type[] getMethodParameterTypes() { 189 return m_methodParameterTypes; 190 } 191 192 197 public String getAspectQualifiedName() { 198 return m_aspectQualifiedName; 199 } 200 201 206 public String getAspectClassName() { 207 return m_aspectClassName; 208 } 209 210 215 public DeploymentModel getAspectDeploymentModel() { 216 return m_aspectDeploymentModel; 217 } 218 219 224 public String getName() { 225 return m_name; 226 } 227 228 233 public void setMethodToArgIndexes(final int[] map) { 234 m_methodToArgIndexes = map; 235 } 236 237 242 public int[] getMethodToArgIndexes() { 243 return m_methodToArgIndexes; 244 } 245 246 251 public String getSpecialArgumentTypeDesc() { 252 return m_specialArgumentTypeDesc; 253 } 254 255 260 public String getSpecialArgumentTypeName() { 261 return m_specialArgumentTypeName; 262 } 263 264 269 public AdviceType getType() { 270 return m_type; 271 } 272 273 278 public boolean hasTargetWithRuntimeCheck() { 279 return m_targetWithRuntimeCheck; 280 } 281 282 287 public ExpressionInfo getExpressionInfo() { 288 return m_expressionInfo; 289 } 290 291 296 public ExpressionContext getExpressionContext() { 297 return m_expressionContext; 298 } 299 300 305 public AdviceDefinition getAdviceDefinition() { 306 return m_adviceDef; 307 } 308 309 public String toString() { 310 StringBuffer sb = new StringBuffer ("AdviceInfo["); 311 sb.append(m_type).append(','); 312 sb.append(m_aspectQualifiedName).append(','); 313 sb.append(m_name).append(','); 314 sb.append(m_methodName).append(','); 315 sb.append(m_methodSignature).append(','); 316 sb.append(m_methodParameterTypes).append(','); 317 sb.append(m_specialArgumentTypeDesc).append(','); 318 sb.append(m_expressionInfo).append(','); 319 sb.append(m_expressionContext).append(','); 320 sb.append(m_targetWithRuntimeCheck).append(']'); 321 sb.append(hashCode()); 322 return sb.toString(); 323 } 324 325 } | Popular Tags |