public class TypePatternClassFilter extends java.lang.Object implements ClassFilter
ClassFilter implementation using AspectJ type matching.| Modifier and Type | Field and Description |
|---|---|
private TypePatternMatcher |
aspectJTypePatternMatcher |
private java.lang.String |
typePattern |
TRUE| Constructor and Description |
|---|
TypePatternClassFilter()
Creates a new instance of the
TypePatternClassFilter class. |
TypePatternClassFilter(java.lang.String typePattern)
Create a fully configured
TypePatternClassFilter using the
given type pattern. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getTypePattern() |
boolean |
matches(java.lang.Class<?> clazz)
Should the pointcut apply to the given interface or target class?
|
private java.lang.String |
replaceBooleanOperators(java.lang.String pcExpr)
If a type pattern has been specified in XML, the user cannot
write
and as "&&" (though && will work). |
void |
setTypePattern(java.lang.String typePattern)
Set the AspectJ type pattern to match.
|
private java.lang.String typePattern
private TypePatternMatcher aspectJTypePatternMatcher
public TypePatternClassFilter()
TypePatternClassFilter class.
This is the JavaBean constructor; be sure to set the
typePattern property, else a
no doubt fatal IllegalStateException will be thrown
when the matches(Class) method is first invoked.
public TypePatternClassFilter(java.lang.String typePattern)
TypePatternClassFilter using the
given type pattern.typePattern - the type pattern that AspectJ weaver should parsejava.lang.IllegalArgumentException - if the supplied typePattern is null
or is recognized as invalidpublic void setTypePattern(java.lang.String typePattern)
Examples include:
org.springframework.beans.*
This will match any class or interface in the given package.
org.springframework.beans.ITestBean+
This will match the ITestBean interface and any class
that implements it.
These conventions are established by AspectJ, not Spring AOP.
typePattern - the type pattern that AspectJ weaver should parsejava.lang.IllegalArgumentException - if the supplied typePattern is null
or is recognized as invalidpublic java.lang.String getTypePattern()
public boolean matches(java.lang.Class<?> clazz)
matches in interface ClassFilterclazz - candidate target classjava.lang.IllegalStateException - if no setTypePattern(String) has been setprivate java.lang.String replaceBooleanOperators(java.lang.String pcExpr)
and as "&&" (though && will work).
We also allow and between two sub-expressions.
This method converts back to && for the AspectJ pointcut parser.