* @param aspectDef the aspect definition
*/
private static void handlePointcutDefinitions(final Element aspectElement,
final AspectDefinition aspectDef) {
for (Iterator it2 = aspectDef.getPointcutDefs().iterator(); it2.hasNext();) {
PointcutDefinition pointcutDef = (PointcutDefinition)it2.next();
Element pointcutDefElement = aspectElement.addElement("pointcut-def");
pointcutDefElement.addAttribute("name", pointcutDef.getName());
pointcutDefElement.addAttribute("non-reentrant", pointcutDef.getNonReentrant());
PointcutType pointcutType = pointcutDef.getType();
if (pointcutType.equals(PointcutType.EXECUTION)) {
pointcutDefElement.addAttribute("type", "method");
}
else if (pointcutType.equals(PointcutType.CALL)) {
pointcutDefElement.addAttribute("type", "callerSide");
}
else if (pointcutType.equals(PointcutType.GET)) {
pointcutDefElement.addAttribute("type", "getField");
}
else if (pointcutType.equals(PointcutType.SET)) {
pointcutDefElement.addAttribute("type", "setField");
}
else if (pointcutType.equals(PointcutType.CFLOW)) {
pointcutDefElement.addAttribute("type", "cflow");
}
else if (pointcutType.equals(PointcutType.THROWS)) {
pointcutDefElement.addAttribute("type", "throws");
}
else if (pointcutType.equals(PointcutType.CLASS)) {
pointcutDefElement.addAttribute("type", "class");
}
else {
throw new ExpressionException("pointcut type not supported: " + pointcutType);
}
Expression.createExpressionTemplate(
aspectDef.getName(),
pointcutDef.getExpression(),
"",
pointcutDef.getName(),
pointcutType
);
pointcutDefElement.addAttribute("pattern", pointcutDef.getExpression());
}
}