Package org.springframework.aop.aspectj
Class TypePatternClassFilter
java.lang.Object
org.springframework.aop.aspectj.TypePatternClassFilter
- All Implemented Interfaces:
ClassFilter
Spring AOP
ClassFilter implementation using AspectJ type matching.- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller, Sam Brannen
-
Field Summary
Fields inherited from interface org.springframework.aop.ClassFilter
TRUE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of theTypePatternClassFilterclass.TypePatternClassFilter(String typePattern) Create a fully configuredTypePatternClassFilterusing the given type pattern. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the AspectJ type pattern to match.inthashCode()booleanShould the pointcut apply to the given interface or target class?voidsetTypePattern(String typePattern) Set the AspectJ type pattern to match.toString()
-
Constructor Details
-
TypePatternClassFilter
public TypePatternClassFilter()Creates a new instance of theTypePatternClassFilterclass.This is the JavaBean constructor; be sure to set the
typePatternproperty, else a no doubt fatalIllegalStateExceptionwill be thrown when thematches(Class)method is first invoked. -
TypePatternClassFilter
Create a fully configuredTypePatternClassFilterusing the given type pattern.- Parameters:
typePattern- the type pattern that AspectJ weaver should parse
-
-
Method Details
-
setTypePattern
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 theITestBeaninterface and any class that implements it.These conventions are established by AspectJ, not Spring AOP.
- Parameters:
typePattern- the type pattern that AspectJ weaver should parse
-
getTypePattern
Return the AspectJ type pattern to match. -
matches
Should the pointcut apply to the given interface or target class?- Specified by:
matchesin interfaceClassFilter- Parameters:
clazz- candidate target class- Returns:
- whether the advice should apply to this candidate target class
- Throws:
IllegalStateException- if nosetTypePattern(String)has been set
-
equals
-
hashCode
public int hashCode() -
toString
-