Interface ClassFilter

All Known Implementing Classes:
AnnotationClassFilter, AspectJExpressionPointcut, ControlFlowPointcut, DefaultIntroductionAdvisor, RootClassFilter, TypePatternClassFilter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@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.

Concrete implementations of this interface typically should provide proper implementations of Object.equals(Object) and Object.hashCode() in order to allow the filter to be used in caching scenarios — for example, in proxies generated by CGLIB.

Author:
Rod Johnson
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ClassFilter
    Canonical instance of a ClassFilter that matches all classes.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    matches(Class<?> clazz)
    Should the pointcut apply to the given interface or target class?
  • Field Details

    • TRUE

      static final ClassFilter TRUE
      Canonical instance of a ClassFilter that matches all classes.
  • Method Details

    • matches

      boolean matches(Class<?> clazz)
      Should the pointcut apply to the given interface or target class?
      Parameters:
      clazz - the candidate target class
      Returns:
      whether the advice should apply to the given target class