程序包 infra.aop

接口 ClassFilter

所有已知实现类:
AnnotationClassFilter, AnnotationMatchingPointcut.AnnotationCandidateClassFilter, AspectJExpressionPointcut, ClassFilter.IntersectionClassFilter, ClassFilter.NegateClassFilter, ClassFilter.UnionClassFilter, ControlFlowPointcut, DefaultIntroductionAdvisor, RootClassFilter, TrueClassFilter, TypePatternClassFilter
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface ClassFilter
Filter that restricts matching of a pointcut or introduction to a given set of target classes.

Can be used as part of a Pointcut or for the entire targeting of an IntroductionAdvisor.

WARNING: Concrete implementations of this interface must provide proper implementations of Object.equals(Object), Object.hashCode(), and Object.toString() in order to allow the filter to be used in caching scenarios — for example, in proxies generated by CGLIB. As of 4.0, the toString() implementation must generate a unique string representation that aligns with the logic used to implement equals(). See concrete implementations of this interface within the framework for examples.

从以下版本开始:
3.0
作者:
Rod Johnson, TODAY 2021/2/1 18:12
另请参阅:
  • 字段详细资料

    • TRUE

      static final ClassFilter TRUE
      Canonical instance of a ClassFilter that matches all classes.
  • 方法详细资料

    • matches

      boolean matches(Class<?> clazz)
      Should the pointcut apply to the given interface or target class?
      参数:
      clazz - the candidate target class
      返回:
      whether the advice should apply to the given target class
    • union

      static ClassFilter union(ClassFilter cf1, ClassFilter cf2)
      Match all classes that either (or both) of the given ClassFilters matches.
      参数:
      cf1 - the first ClassFilter
      cf2 - the second ClassFilter
      返回:
      a distinct ClassFilter that matches all classes that either of the given ClassFilter matches
    • union

      static ClassFilter union(ClassFilter[] classFilters)
      Match all classes that either (or all) of the given ClassFilters matches.
      参数:
      classFilters - the ClassFilters to match
      返回:
      a distinct ClassFilter that matches all classes that either of the given ClassFilter matches
    • intersection

      static ClassFilter intersection(ClassFilter cf1, ClassFilter cf2)
      Match all classes that both of the given ClassFilters match.
      参数:
      cf1 - the first ClassFilter
      cf2 - the second ClassFilter
      返回:
      a distinct ClassFilter that matches all classes that both of the given ClassFilter match
    • intersection

      static ClassFilter intersection(ClassFilter[] classFilters)
      Match all classes that all of the given ClassFilters match.
      参数:
      classFilters - the ClassFilters to match
      返回:
      a distinct ClassFilter that matches all classes that both of the given ClassFilter match
    • negate

      static ClassFilter negate(ClassFilter classFilter)
      Return a class filter that represents the logical negation of the specified filter instance.
      参数:
      classFilter - the ClassFilter to negate
      返回:
      a filter that represents the logical negation of the specified filter
      从以下版本开始:
      4.0