类 DeclareParentsAdvisor
- java.lang.Object
- org.springframework.aop.aspectj.DeclareParentsAdvisor
- 所有已实现的接口:
Advisor
,IntroductionAdvisor
,IntroductionInfo
public class DeclareParentsAdvisor extends Object implements IntroductionAdvisor
Introduction advisor delegating to the given object. Implements AspectJ annotation-style behavior for the DeclareParents annotation.- 从以下版本开始:
- 2.0
- 作者:
- Rod Johnson, Ramnivas Laddad
构造器概要
构造器 构造器 说明 DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Class<?> defaultImpl)
Create a new advisor for this DeclareParents field.DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Object delegateRef)
Create a new advisor for this DeclareParents field.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Advice
getAdvice()
Return the advice part of this aspect.ClassFilter
getClassFilter()
Return the filter determining which target classes this introduction should apply to.Class<?>[]
getInterfaces()
Return the additional interfaces introduced by this Advisor or Advice.boolean
isPerInstance()
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.void
validateInterfaces()
Can the advised interfaces be implemented by the introduction advice?
构造器详细资料
DeclareParentsAdvisor
public DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Class<?> defaultImpl)
Create a new advisor for this DeclareParents field.- 参数:
interfaceType
- static field defining the introductiontypePattern
- type pattern the introduction is restricted todefaultImpl
- the default implementation class
DeclareParentsAdvisor
public DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Object delegateRef)
Create a new advisor for this DeclareParents field.- 参数:
interfaceType
- static field defining the introductiontypePattern
- type pattern the introduction is restricted todelegateRef
- the delegate implementation object
方法详细资料
getClassFilter
public ClassFilter getClassFilter()
从接口复制的说明:IntroductionAdvisor
Return the filter determining which target classes this introduction should apply to.This represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.
- 指定者:
getClassFilter
在接口中IntroductionAdvisor
- 返回:
- the class filter
validateInterfaces
public void validateInterfaces() throws IllegalArgumentException
从接口复制的说明:IntroductionAdvisor
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.- 指定者:
validateInterfaces
在接口中IntroductionAdvisor
- 抛出:
IllegalArgumentException
- if the advised interfaces can't be implemented by the introduction advice
isPerInstance
public boolean isPerInstance()
从接口复制的说明:Advisor
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.Note that this method is not currently used by the framework. Typical Advisor implementations always return
true
. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.- 指定者:
isPerInstance
在接口中Advisor
- 返回:
- whether this advice is associated with a particular target instance
getAdvice
public Advice getAdvice()
从接口复制的说明:Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.- 指定者:
getAdvice
在接口中Advisor
- 返回:
- the advice that should apply if the pointcut matches
- 另请参阅:
MethodInterceptor
,BeforeAdvice
,ThrowsAdvice
,AfterReturningAdvice
getInterfaces
public Class<?>[] getInterfaces()
从接口复制的说明:IntroductionInfo
Return the additional interfaces introduced by this Advisor or Advice.- 指定者:
getInterfaces
在接口中IntroductionInfo
- 返回:
- the introduced interfaces