public class DefaultIntroductionAdvisor extends Object implements IntroductionAdvisor, ClassFilter, org.springframework.core.Ordered, Serializable
IntroductionAdvisor implementation
that by default applies to any class.EMPTY_ADVICETRUE| 构造器和说明 |
|---|
DefaultIntroductionAdvisor(Advice advice)
Create a DefaultIntroductionAdvisor for the given advice.
|
DefaultIntroductionAdvisor(Advice advice,
IntroductionInfo introductionInfo)
Create a DefaultIntroductionAdvisor for the given advice.
|
DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice,
Class<?> intf)
Create a DefaultIntroductionAdvisor for the given advice.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addInterface(Class<?> intf)
Add the specified interface to the list of interfaces to introduce.
|
boolean |
equals(Object other) |
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.
|
int |
getOrder() |
int |
hashCode() |
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.
|
boolean |
matches(Class<?> clazz)
Should the pointcut apply to the given interface or target class?
|
void |
setOrder(int order) |
String |
toString() |
void |
validateInterfaces()
Can the advised interfaces be implemented by the introduction advice?
|
public DefaultIntroductionAdvisor(Advice advice)
advice - the Advice to apply (may implement the
IntroductionInfo interface)addInterface(java.lang.Class<?>)public DefaultIntroductionAdvisor(Advice advice, @Nullable IntroductionInfo introductionInfo)
advice - the Advice to applyintroductionInfo - the IntroductionInfo that describes
the interface to introduce (may be null)public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class<?> intf)
advice - the Advice to applyintf - the interface to introducepublic void addInterface(Class<?> intf)
intf - the interface to introducepublic Class<?>[] getInterfaces()
IntroductionInfogetInterfaces 在接口中 IntroductionInfopublic void validateInterfaces()
throws IllegalArgumentException
IntroductionAdvisorvalidateInterfaces 在接口中 IntroductionAdvisorIllegalArgumentException - if the advised interfaces can't be
implemented by the introduction advicepublic void setOrder(int order)
public int getOrder()
getOrder 在接口中 org.springframework.core.Orderedpublic Advice getAdvice()
AdvisorgetAdvice 在接口中 AdvisorMethodInterceptor,
BeforeAdvice,
ThrowsAdvice,
AfterReturningAdvicepublic 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 在接口中 Advisorpublic ClassFilter getClassFilter()
IntroductionAdvisorThis represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.
getClassFilter 在接口中 IntroductionAdvisorpublic boolean matches(Class<?> clazz)
ClassFiltermatches 在接口中 ClassFilterclazz - the candidate target class