final String specialArgumentType,
final String aspectName,
final String aspectClassName,
final MethodInfo methodInfo,
final AspectDefinition aspectDef) {
ExpressionInfo expressionInfo = new ExpressionInfo(
expression,
aspectDef.getQualifiedName()
);
// support for pointcut signature
String adviceCallSignature = null;
String resolvedSpecialArgumentType = specialArgumentType;
if (adviceName.indexOf('(') > 0) {
adviceCallSignature = adviceName.substring(adviceName.indexOf('(') + 1, adviceName.lastIndexOf(')'));
String[] parameters = Strings.splitString(adviceCallSignature, ",");
for (int i = 0; i < parameters.length; i++) {
String[] parameterInfo = Strings.splitString(
Strings.replaceSubString(parameters[i].trim(), " ", " "),
" "
);
// Note: for XML defined aspect, we support anonymous parameters like
// advice(JoinPoint, Rtti) as well as abbreviations, so we have to assign
// them a name here, as well as their real type
String paramName, paramType = null;
if (parameterInfo.length == 2) {
paramName = parameterInfo[1];
paramType = parameterInfo[0];
//FIXME -- ?? what ??
} else {
paramName = "anonymous_" + i;
paramType = (String) Pattern.ABBREVIATIONS.get(parameterInfo[0]);
}
// skip the parameter if this ones is a after returning / throwing binding
if (paramName.equals(specialArgumentType)) {
resolvedSpecialArgumentType = paramType;
expressionInfo.setSpecialArgumentName(paramName);
} else {
expressionInfo.addArgument(paramName, paramType, aspectDef.getClassInfo().getClassLoader());
}
}
}
// check that around advice return Object else the compiler will fail