类 TypePatternClassFilter
- java.lang.Object
- org.springframework.aop.aspectj.TypePatternClassFilter
- 所有已实现的接口:
ClassFilter
public class TypePatternClassFilter extends Object implements ClassFilter
Spring AOPClassFilter
implementation using AspectJ type matching.- 从以下版本开始:
- 2.0
- 作者:
- Rod Johnson, Juergen Hoeller
字段概要
从接口继承的字段 org.springframework.aop.ClassFilter
TRUE
构造器概要
构造器 构造器 说明 TypePatternClassFilter()
Creates a new instance of theTypePatternClassFilter
class.TypePatternClassFilter(String typePattern)
Create a fully configuredTypePatternClassFilter
using the given type pattern.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getTypePattern()
Return the AspectJ type pattern to match.boolean
matches(Class<?> clazz)
Should the pointcut apply to the given interface or target class?void
setTypePattern(String typePattern)
Set the AspectJ type pattern to match.
构造器详细资料
TypePatternClassFilter
public TypePatternClassFilter()
Creates a new instance of theTypePatternClassFilter
class.This is the JavaBean constructor; be sure to set the
typePattern
property, else a no doubt fatalIllegalStateException
will be thrown when thematches(Class)
method is first invoked.
TypePatternClassFilter
public TypePatternClassFilter(String typePattern)
Create a fully configuredTypePatternClassFilter
using the given type pattern.- 参数:
typePattern
- the type pattern that AspectJ weaver should parse- 抛出:
IllegalArgumentException
- if the suppliedtypePattern
isnull
or is recognized as invalid
方法详细资料
setTypePattern
public void setTypePattern(String typePattern)
Set the AspectJ type pattern to match.Examples include:
org.springframework.beans.*
This will match any class or interface in the given package.org.springframework.beans.ITestBean+
This will match theITestBean
interface and any class that implements it.These conventions are established by AspectJ, not Spring AOP.
- 参数:
typePattern
- the type pattern that AspectJ weaver should parse- 抛出:
IllegalArgumentException
- if the suppliedtypePattern
isnull
or is recognized as invalid
getTypePattern
public String getTypePattern()
Return the AspectJ type pattern to match.
matches
public boolean matches(Class<?> clazz)
Should the pointcut apply to the given interface or target class?- 指定者:
matches
在接口中ClassFilter
- 参数:
clazz
- candidate target class- 返回:
- whether the advice should apply to this candidate target class
- 抛出:
IllegalStateException
- if nosetTypePattern(String)
has been set