1 8 package org.codehaus.aspectwerkz.aspect; 9 10 import org.codehaus.aspectwerkz.transform.inlining.AsmHelper; 11 import org.codehaus.aspectwerkz.expression.ExpressionInfo; 12 import org.codehaus.aspectwerkz.expression.ExpressionContext; 13 import org.codehaus.aspectwerkz.definition.AdviceDefinition; 14 import org.codehaus.aspectwerkz.DeploymentModel; 15 import org.objectweb.asm.Type; 16 17 import java.io.Serializable ; 18 19 26 public class AdviceInfo implements Serializable { 27 28 public final static AdviceInfo[] EMPTY_ADVICE_INFO_ARRAY = new AdviceInfo[0]; 29 30 public final static int JOINPOINT_ARG = -0x1; 33 public final static int STATIC_JOINPOINT_ARG = -0x2; 34 public final static int TARGET_ARG = -0x3; 35 public final static int THIS_ARG = -0x4; 36 public final static int VALID_NON_AW_AROUND_CLOSURE_TYPE = -0x5; 37 public final static int SPECIAL_ARGUMENT = -0x6; 38 public static final int CUSTOM_JOIN_POINT_ARG = -0x7; 39 40 43 private String m_methodName; 44 45 48 private String m_methodSignature; 49 50 53 private Type[] m_methodParameterTypes; 54 55 59 private final String m_name; 60 61 64 private String m_aspectClassName; 65 66 69 private String m_aspectQualifiedName; 70 71 74 private DeploymentModel m_aspectDeploymentModel; 75 76 81 private int[] m_methodToArgIndexes; 82 83 86 private String m_specialArgumentTypeDesc; 87 88 91 private String m_specialArgumentTypeName; 92 93 96 private AdviceType m_type; 97 98 101 private boolean m_targetWithRuntimeCheck; 102 103 106 private ExpressionInfo m_expressionInfo; 107 108 111 private ExpressionContext m_expressionContext; 112 113 116 private AdviceDefinition m_adviceDef; 117 118 137 public AdviceInfo(final String aspectQualifiedName, 138 final String aspectClassName, 139 final DeploymentModel aspectDeploymentModel, 140 final String methodName, 141 final String methodSignature, 142 final Type[] methodParameterTypes, 143 final AdviceType type, 144 final String specialArgumentType, 145 final String adviceName, 146 final boolean targetWithRuntimeCheck, 147 final ExpressionInfo expressionInfo, 148 final ExpressionContext expressionContext, 149 final AdviceDefinition adviceDef) { 150 m_aspectQualifiedName = aspectQualifiedName; 151 m_aspectClassName = aspectClassName; 152 m_aspectDeploymentModel = aspectDeploymentModel; 153 m_methodName = methodName; 154 m_methodSignature = methodSignature; 155 m_methodParameterTypes = methodParameterTypes; 156 m_type = type; 157 if (specialArgumentType != null && specialArgumentType.length()>0) { m_specialArgumentTypeDesc = AsmHelper.convertReflectDescToTypeDesc(specialArgumentType); 159 m_specialArgumentTypeName = specialArgumentType.replace('.', '/'); 160 } 161 m_name = adviceName; 162 m_targetWithRuntimeCheck = targetWithRuntimeCheck; 163 m_expressionInfo = expressionInfo; 164 m_expressionContext = expressionContext; 165 m_adviceDef = adviceDef; 166 } 167 168 173 public String getMethodName() { 174 return m_methodName; 175 } 176 177 182 public String getMethodSignature() { 183 return m_methodSignature; 184 } 185 186 191 public Type[] getMethodParameterTypes() { 192 return m_methodParameterTypes; 193 } 194 195 200 public String getAspectQualifiedName() { 201 return m_aspectQualifiedName; 202 } 203 204 209 public String getAspectClassName() { 210 return m_aspectClassName; 211 } 212 213 218 public DeploymentModel getAspectDeploymentModel() { 219 return m_aspectDeploymentModel; 220 } 221 222 227 public String getName() { 228 return m_name; 229 } 230 231 236 public void setMethodToArgIndexes(final int[] map) { 237 m_methodToArgIndexes = map; 238 } 239 240 245 public int[] getMethodToArgIndexes() { 246 return m_methodToArgIndexes; 247 } 248 249 254 public String getSpecialArgumentTypeDesc() { 255 return m_specialArgumentTypeDesc; 256 } 257 258 263 public String getSpecialArgumentTypeName() { 264 return m_specialArgumentTypeName; 265 } 266 267 272 public AdviceType getType() { 273 return m_type; 274 } 275 276 281 public boolean hasTargetWithRuntimeCheck() { 282 return m_targetWithRuntimeCheck; 283 } 284 285 290 public ExpressionInfo getExpressionInfo() { 291 return m_expressionInfo; 292 } 293 294 299 public ExpressionContext getExpressionContext() { 300 return m_expressionContext; 301 } 302 303 308 public AdviceDefinition getAdviceDefinition() { 309 return m_adviceDef; 310 } 311 312 public String toString() { 313 StringBuffer sb = new StringBuffer ("AdviceInfo["); 314 sb.append(m_type).append(','); 315 sb.append(m_aspectQualifiedName).append(','); 316 sb.append(m_name).append(','); 317 sb.append(m_methodName).append(','); 318 sb.append(m_methodSignature).append(','); 319 sb.append(m_methodParameterTypes).append(','); 320 sb.append(m_specialArgumentTypeDesc).append(','); 321 sb.append(m_expressionInfo).append(','); 322 sb.append(m_expressionContext).append(','); 323 sb.append(m_targetWithRuntimeCheck).append(']'); 324 sb.append(hashCode()); 325 return sb.toString(); 326 } 327 328 } | Popular Tags |