public class DeclareParentsAdvisor extends Object implements IntroductionAdvisor
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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?
Invoked before adding an IntroductionAdvisor.
|
public DeclareParentsAdvisor(Class interfaceType, String typePattern, Class defaultImpl)
interfaceType
- static field defining the introductiontypePattern
- type pattern the introduction is restricted todefaultImpl
- the default implementation classpublic DeclareParentsAdvisor(Class interfaceType, String typePattern, Object delegateRef)
interfaceType
- static field defining the introductiontypePattern
- type pattern the introduction is restricted todelegateRef
- the delegate implementation objectpublic ClassFilter getClassFilter()
IntroductionAdvisor
This represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.
getClassFilter
in interface IntroductionAdvisor
public void validateInterfaces() throws IllegalArgumentException
IntroductionAdvisor
validateInterfaces
in interface IntroductionAdvisor
IllegalArgumentException
- if the advised interfaces can't be
implemented by the introduction advicepublic boolean isPerInstance()
Advisor
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
in interface Advisor
public Advice getAdvice()
Advisor
getAdvice
in interface Advisor
MethodInterceptor
,
BeforeAdvice
,
ThrowsAdvice
,
AfterReturningAdvice
public Class[] getInterfaces()
IntroductionInfo
getInterfaces
in interface IntroductionInfo