接口 CallbackFilter

  • 所有已知实现类:
    CallbackHelper

    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​(java.lang.reflect.Method method)
      Map a method to a callback.
      boolean equals​(java.lang.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.
    • 方法详细资料

      • accept

        int accept​(java.lang.reflect.Method method)
        Map a method to a callback.
        参数:
        method - the intercepted method
        返回:
        the index into the array of callbacks (as specified by Enhancer.setCallbacks(net.sf.cglib.proxy.Callback[])) to use for the method,
      • equals

        boolean equals​(java.lang.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 在类中 java.lang.Object