Package org.springframework.aop.aspectj
Class DeclareParentsAdvisor
java.lang.Object
org.springframework.aop.aspectj.DeclareParentsAdvisor
- All Implemented Interfaces:
Advisor
,IntroductionAdvisor
,IntroductionInfo
Introduction advisor delegating to the given object.
Implements AspectJ annotation-style behavior for the DeclareParents annotation.
- Since:
- 2.0
- Author:
- Rod Johnson, Ramnivas Laddad
-
Field Summary
Fields inherited from interface org.springframework.aop.Advisor
EMPTY_ADVICE
-
Constructor Summary
ConstructorDescriptionDeclareParentsAdvisor
(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. -
Method Summary
Modifier and TypeMethodDescriptionReturn the advice part of this aspect.Return the filter determining which target classes this introduction should apply to.Class<?>[]
Return the additional interfaces introduced by this Advisor or Advice.boolean
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
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.
-
Constructor Details
-
DeclareParentsAdvisor
Create a new advisor for this DeclareParents field.- Parameters:
interfaceType
- static field defining the introductiontypePattern
- type pattern the introduction is restricted todefaultImpl
- the default implementation class
-
DeclareParentsAdvisor
Create a new advisor for this DeclareParents field.- Parameters:
interfaceType
- static field defining the introductiontypePattern
- type pattern the introduction is restricted todelegateRef
- the delegate implementation object
-
-
Method Details
-
getClassFilter
Description copied from interface: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.
- Specified by:
getClassFilter
in interfaceIntroductionAdvisor
- Returns:
- the class filter
-
validateInterfaces
Description copied from interface:IntroductionAdvisor
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.- Specified by:
validateInterfaces
in interfaceIntroductionAdvisor
- Throws:
IllegalArgumentException
- if the advised interfaces can't be implemented by the introduction advice
-
isPerInstance
public boolean isPerInstance()Description copied from interface: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.- Specified by:
isPerInstance
in interfaceAdvisor
- Returns:
- whether this advice is associated with a particular target instance
-
getAdvice
Description copied from interface:Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc. -
getInterfaces
Description copied from interface:IntroductionInfo
Return the additional interfaces introduced by this Advisor or Advice.- Specified by:
getInterfaces
in interfaceIntroductionInfo
- Returns:
- the introduced interfaces
-