public class DeclareParentsAdvisor extends java.lang.Object implements IntroductionAdvisor
EMPTY_ADVICE
Constructor and Description |
---|
DeclareParentsAdvisor(java.lang.Class<?> interfaceType,
java.lang.String typePattern,
java.lang.Class<?> defaultImpl)
Create a new advisor for this DeclareParents field.
|
DeclareParentsAdvisor(java.lang.Class<?> interfaceType,
java.lang.String typePattern,
java.lang.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.
|
java.lang.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(java.lang.Class<?> interfaceType, java.lang.String typePattern, java.lang.Class<?> defaultImpl)
interfaceType
- static field defining the introductiontypePattern
- type pattern the introduction is restricted todefaultImpl
- the default implementation classpublic DeclareParentsAdvisor(java.lang.Class<?> interfaceType, java.lang.String typePattern, java.lang.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 java.lang.IllegalArgumentException
IntroductionAdvisor
validateInterfaces
in interface IntroductionAdvisor
java.lang.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 java.lang.Class<?>[] getInterfaces()
IntroductionInfo
getInterfaces
in interface IntroductionInfo