类 ControlFlowPointcut
- 所有已实现的接口:
ClassFilter,MethodMatcher,Pointcut,Serializable
- 从以下版本开始:
- 4.0 2022/3/9 23:01
- 作者:
- Rod Johnson, Rob Harrop, Juergen Hoeller, Sam Brannen, Harry Yang
- 另请参阅:
-
嵌套类概要
从接口继承的嵌套类/接口 infra.aop.ClassFilter
ClassFilter.IntersectionClassFilter, ClassFilter.NegateClassFilter, ClassFilter.UnionClassFilter从接口继承的嵌套类/接口 infra.aop.MethodMatcher
MethodMatcher.ClassFilterAwareUnionIntroductionAwareMethodMatcher, MethodMatcher.ClassFilterAwareUnionMethodMatcher, MethodMatcher.IntersectionIntroductionAwareMethodMatcher, MethodMatcher.IntersectionMethodMatcher, MethodMatcher.NegateMethodMatcher, MethodMatcher.UnionIntroductionAwareMethodMatcher, MethodMatcher.UnionMethodMatcher从接口继承的嵌套类/接口 infra.aop.Pointcut
Pointcut.GetterPointcut, Pointcut.SetterPointcut -
字段概要
字段修饰符和类型字段说明protected final Class<?>The class against which to match.private final AtomicIntegerAn immutable list of distinct method name patterns against which to match.从接口继承的字段 infra.aop.ClassFilter
TRUE从接口继承的字段 infra.aop.MethodMatcher
TRUE -
构造器概要
构造器构造器说明ControlFlowPointcut(Class<?> clazz) Construct a new pointcut that matches all control flows below the given class.ControlFlowPointcut(Class<?> clazz, String methodNamePattern) Construct a new pointcut that matches all calls below a method matching the given method name pattern in the given class.ControlFlowPointcut(Class<?> clazz, String... methodNamePatterns) Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class.ControlFlowPointcut(Class<?> clazz, List<String> methodNamePatterns) Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class. -
方法概要
修饰符和类型方法说明booleanReturn the ClassFilter for this pointcut.intGet the number of timesmatches(MethodInvocation)has been evaluated.Return the MethodMatcher for this pointcut.inthashCode()protected final voidIncrement theevaluation count.protected booleanDetermine if the given method name matches the method name pattern at the specified index.protected booleanDetermine if the given method name matches the method name pattern.booleanIs this MethodMatcher dynamic, that is, must a final call be made on theMethodMatcher.matches(MethodInvocation)method at runtime even if the 2-arg matches method returnstrue?booleanSubclasses can override this for greater filtering (and performance).booleanSubclasses can override this if it's possible to filter out some candidate classes.booleanmatches(MethodInvocation invocation) Check whether there a runtime (dynamic) match for this method, which must have matched statically.toString()
-
字段详细资料
-
clazz
The class against which to match. -
methodNamePatterns
An immutable list of distinct method name patterns against which to match. -
evaluationCount
-
-
构造器详细资料
-
ControlFlowPointcut
Construct a new pointcut that matches all control flows below the given class.- 参数:
clazz- the class
-
ControlFlowPointcut
Construct a new pointcut that matches all calls below a method matching the given method name pattern in the given class.If no method name pattern is given, the pointcut matches all control flows below the given class.
- 参数:
clazz- the classmethodNamePattern- the method name pattern (may benull)
-
ControlFlowPointcut
Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class.If no method name pattern is given, the pointcut matches all control flows below the given class.
- 参数:
clazz- the classmethodNamePatterns- the method name patterns (potentially empty)
-
ControlFlowPointcut
Construct a new pointcut that matches all calls below a method matching one of the given method name patterns in the given class.If no method name pattern is given, the pointcut matches all control flows below the given class.
- 参数:
clazz- the classmethodNamePatterns- the method name patterns (potentially empty)
-
-
方法详细资料
-
matches
Subclasses can override this for greater filtering (and performance).The default implementation always returns
true.- 指定者:
matches在接口中ClassFilter- 参数:
clazz- the candidate target class- 返回:
- whether the advice should apply to the given target class
-
matches
Subclasses can override this if it's possible to filter out some candidate classes.The default implementation always returns
true.- 指定者:
matches在接口中MethodMatcher- 参数:
method- the candidate methodtargetClass- the target class- 返回:
- whether or not this method matches on application startup.
-
isRuntime
public boolean isRuntime()从接口复制的说明:MethodMatcherIs this MethodMatcher dynamic, that is, must a final call be made on theMethodMatcher.matches(MethodInvocation)method at runtime even if the 2-arg matches method returnstrue?Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation,
- 指定者:
isRuntime在接口中MethodMatcher- 返回:
- whether or not a runtime match via the 1-arg
MethodMatcher.matches(MethodInvocation)method is required if static matching passed
-
matches
从接口复制的说明:MethodMatcherCheck whether there a runtime (dynamic) match for this method, which must have matched statically.This method is invoked only if the 2-arg matches method returns
truefor the given method and target class, and if theMethodMatcher.isRuntime()method returnstrue. Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run.- 指定者:
matches在接口中MethodMatcher- 参数:
invocation- runtime invocation contains the candidate method and target class, arguments to the method- 返回:
- whether there's a runtime match
- 另请参阅:
-
getEvaluations
public int getEvaluations()Get the number of timesmatches(MethodInvocation)has been evaluated.Useful for optimization and testing purposes.
-
incrementEvaluationCount
protected final void incrementEvaluationCount()Increment theevaluation count. -
isMatch
Determine if the given method name matches the method name pattern at the specified index.This method is invoked by
matches(MethodInvocation).The default implementation retrieves the method name pattern from
methodNamePatternsand delegates toisMatch(String, String).Can be overridden in subclasses — for example, to support regular expressions.
- 参数:
methodName- the method name to checkpatternIndex- the index of the method name pattern- 返回:
trueif the method name matches the pattern at the specified index- 另请参阅:
-
isMatch
Determine if the given method name matches the method name pattern.This method is invoked by
isMatch(String, int).The default implementation checks for direct equality as well as
xxx*,*xxx,*xxx*, andxxx*yyymatches.Can be overridden in subclasses — for example, to support a different style of simple pattern matching.
- 参数:
methodName- the method name to checkmethodNamePattern- the method name pattern- 返回:
trueif the method name matches the pattern- 另请参阅:
-
isMatch(String, int)StringUtils.simpleMatch(String, String)
-
getClassFilter
从接口复制的说明:PointcutReturn the ClassFilter for this pointcut.- 指定者:
getClassFilter在接口中Pointcut- 返回:
- the ClassFilter (never
null)
-
getMethodMatcher
从接口复制的说明:PointcutReturn the MethodMatcher for this pointcut.- 指定者:
getMethodMatcher在接口中Pointcut- 返回:
- the MethodMatcher (never
null)
-
equals
-
hashCode
public int hashCode() -
toString
-