Package org.springframework.aop.support
Class DefaultPointcutAdvisor
- java.lang.Object
- org.springframework.aop.support.AbstractPointcutAdvisor
- org.springframework.aop.support.AbstractGenericPointcutAdvisor
- org.springframework.aop.support.DefaultPointcutAdvisor
- All Implemented Interfaces:
Serializable,Advisor,PointcutAdvisor,Ordered
- Direct Known Subclasses:
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor implements Serializable
Convenient Pointcut-driven Advisor implementation.This is the most commonly used Advisor implementation. It can be used with any pointcut and advice type, except for introductions. There is normally no need to subclass this class, or to implement custom Advisors.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
setPointcut(org.springframework.aop.Pointcut),AbstractGenericPointcutAdvisor.setAdvice(org.aopalliance.aop.Advice), Serialized Form
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
Constructors Constructor Description DefaultPointcutAdvisor()Create an empty DefaultPointcutAdvisor.DefaultPointcutAdvisor(Advice advice)Create a DefaultPointcutAdvisor that matches all methods.DefaultPointcutAdvisor(Pointcut pointcut, Advice advice)Create a DefaultPointcutAdvisor, specifying Pointcut and Advice.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PointcutgetPointcut()Get the Pointcut that drives this advisor.voidsetPointcut(Pointcut pointcut)Specify the pointcut targeting the advice.StringtoString()Methods inherited from class org.springframework.aop.support.AbstractGenericPointcutAdvisor
getAdvice, setAdvice
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
Constructor Detail
DefaultPointcutAdvisor
public DefaultPointcutAdvisor()
Create an empty DefaultPointcutAdvisor.Advice must be set before use using setter methods. Pointcut will normally be set also, but defaults to
Pointcut.TRUE.
DefaultPointcutAdvisor
public DefaultPointcutAdvisor(Advice advice)
Create a DefaultPointcutAdvisor that matches all methods.Pointcut.TRUEwill be used as Pointcut.- Parameters:
advice- the Advice to use
DefaultPointcutAdvisor
public DefaultPointcutAdvisor(Pointcut pointcut, Advice advice)
Create a DefaultPointcutAdvisor, specifying Pointcut and Advice.- Parameters:
pointcut- the Pointcut targeting the Adviceadvice- the Advice to run when Pointcut matches
Method Detail
setPointcut
public void setPointcut(Pointcut pointcut)
Specify the pointcut targeting the advice.Default is
Pointcut.TRUE.
getPointcut
public Pointcut getPointcut()
Description copied from interface:PointcutAdvisorGet the Pointcut that drives this advisor.- Specified by:
getPointcutin interfacePointcutAdvisor
toString
public String toString()
- Overrides:
toStringin classAbstractGenericPointcutAdvisor