接口 CallbackFilter

所有已知实现类:
AbstractCallbackFilter
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface CallbackFilter
Map methods of subclasses generated by Enhancer to a particular callback. The type of the callbacks chosen for each method affects the bytecode generated for that method in the subclass, and cannot change for the life of the class.

Note: CallbackFilter implementations are supposed to be lightweight as cglib might keep CallbackFilter objects alive to enable caching of generated classes. Prefer using static classes for implementation of CallbackFilter.

  • 方法概要

    修饰符和类型
    方法
    说明
    int
    accept(Method method)
    Map a method to a callback.
    boolean
    The CallbackFilter in use affects which cached class the Enhancer will use, so this is a reminder that you should correctly implement equals and hashCode for custom CallbackFilter implementations in order to improve performance.
  • 方法详细资料

    • accept

      int accept(Method method)
      Map a method to a callback.
      参数:
      method - the intercepted method
      返回:
      the index into the array of callbacks (as specified by Enhancer.setCallbacks(cn.taketoday.bytecode.proxy.Callback...)) to use for the method,
    • equals

      boolean equals(Object o)
      The CallbackFilter in use affects which cached class the Enhancer will use, so this is a reminder that you should correctly implement equals and hashCode for custom CallbackFilter implementations in order to improve performance.
      覆盖:
      equals 在类中 Object