public class DeclareParentsAdvisor extends java.lang.Object implements IntroductionAdvisor
| 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()
IntroductionAdvisorThis represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.
getClassFilter in interface IntroductionAdvisorpublic void validateInterfaces()
throws java.lang.IllegalArgumentException
IntroductionAdvisorvalidateInterfaces in interface IntroductionAdvisorjava.lang.IllegalArgumentException - if the advised interfaces can't be
implemented by the introduction advicepublic boolean isPerInstance()
AdvisorNote 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 Advisorpublic Advice getAdvice()
AdvisorgetAdvice in interface AdvisorMethodInterceptor,
BeforeAdvice,
ThrowsAdvice,
AfterReturningAdvicepublic java.lang.Class<?>[] getInterfaces()
IntroductionInfogetInterfaces in interface IntroductionInfo