1 16 17 package org.springframework.aop.config; 18 19 import org.springframework.beans.factory.config.BeanDefinition; 20 import org.springframework.beans.factory.parsing.AbstractComponentDefinition; 21 import org.springframework.util.Assert; 22 23 30 public class PointcutComponentDefinition extends AbstractComponentDefinition { 31 32 private final String pointcutBeanName; 33 34 private final BeanDefinition pointcutDefinition; 35 36 private final String description; 37 38 private final String expression; 39 40 41 public PointcutComponentDefinition(String pointcutBeanName, BeanDefinition pointcutDefinition, String expression) { 42 Assert.notNull(pointcutBeanName, "Bean name must not be null"); 43 Assert.notNull(pointcutDefinition, "Pointcut definition must not be null"); 44 Assert.notNull(expression, "Expression must not be null"); 45 this.pointcutBeanName = pointcutBeanName; 46 this.pointcutDefinition = pointcutDefinition; 47 this.expression = expression; 48 this.description = "Pointcut <name='" + getName() + "', expression=[" + this.expression + "]>"; 49 } 50 51 52 public String getName() { 53 return this.pointcutBeanName; 54 } 55 56 public String getDescription() { 57 return this.description; 58 } 59 60 public BeanDefinition[] getBeanDefinitions() { 61 return new BeanDefinition[] {this.pointcutDefinition}; 62 } 63 64 public Object getSource() { 65 return this.pointcutDefinition.getSource(); 66 } 67 68 } 69 | Popular Tags |