类 DefaultIntroductionAdvisor
- java.lang.Object
- org.springframework.aop.support.DefaultIntroductionAdvisor
- 所有已实现的接口:
Serializable
,Advisor
,ClassFilter
,IntroductionAdvisor
,IntroductionInfo
,Ordered
public class DefaultIntroductionAdvisor extends Object implements IntroductionAdvisor, ClassFilter, Ordered, Serializable
SimpleIntroductionAdvisor
implementation that by default applies to any class.- 从以下版本开始:
- 11.11.2003
- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
- 序列化表格
字段概要
从接口继承的字段 org.springframework.aop.ClassFilter
TRUE
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 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<?> ifc)
Create a DefaultIntroductionAdvisor for the given advice.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addInterface(Class<?> ifc)
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()
Get the order value of this object.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?
构造器详细资料
DefaultIntroductionAdvisor
public DefaultIntroductionAdvisor(Advice advice)
Create a DefaultIntroductionAdvisor for the given advice.- 参数:
advice
- the Advice to apply (may implement theIntroductionInfo
interface)- 另请参阅:
addInterface(java.lang.Class<?>)
DefaultIntroductionAdvisor
public DefaultIntroductionAdvisor(Advice advice, IntroductionInfo introductionInfo)
Create a DefaultIntroductionAdvisor for the given advice.- 参数:
advice
- the Advice to applyintroductionInfo
- the IntroductionInfo that describes the interface to introduce (may benull
)
DefaultIntroductionAdvisor
public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class<?> ifc)
Create a DefaultIntroductionAdvisor for the given advice.- 参数:
advice
- the Advice to applyifc
- the interface to introduce
方法详细资料
addInterface
public void addInterface(Class<?> ifc)
Add the specified interface to the list of interfaces to introduce.- 参数:
ifc
- the interface to introduce
getInterfaces
public Class<?>[] getInterfaces()
从接口复制的说明:IntroductionInfo
Return the additional interfaces introduced by this Advisor or Advice.- 指定者:
getInterfaces
在接口中IntroductionInfo
- 返回:
- the introduced interfaces
validateInterfaces
public void validateInterfaces() throws IllegalArgumentException
从接口复制的说明:IntroductionAdvisor
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.- 指定者:
validateInterfaces
在接口中IntroductionAdvisor
- 抛出:
IllegalArgumentException
- if the advised interfaces can't be implemented by the introduction advice
setOrder
public void setOrder(int order)
getOrder
public int getOrder()
从接口复制的说明:Ordered
Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE
getAdvice
public Advice getAdvice()
从接口复制的说明:Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.- 指定者:
getAdvice
在接口中Advisor
- 返回:
- the advice that should apply if the pointcut matches
- 另请参阅:
MethodInterceptor
,BeforeAdvice
,ThrowsAdvice
,AfterReturningAdvice
isPerInstance
public boolean isPerInstance()
从接口复制的说明: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.- 指定者:
isPerInstance
在接口中Advisor
- 返回:
- whether this advice is associated with a particular target instance
getClassFilter
public ClassFilter getClassFilter()
从接口复制的说明: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.
- 指定者:
getClassFilter
在接口中IntroductionAdvisor
- 返回:
- the class filter
matches
public boolean matches(Class<?> clazz)
从接口复制的说明:ClassFilter
Should the pointcut apply to the given interface or target class?- 指定者:
matches
在接口中ClassFilter
- 参数:
clazz
- the candidate target class- 返回:
- whether the advice should apply to the given target class