Package net.sf.cglib.proxy
Interface CallbackFilter
-
- All Known Implementing Classes:
CallbackHelper
public interface CallbackFilterMap methods of subclasses generated byEnhancerto 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:
CallbackFilterimplementations are supposed to be lightweight as cglib might keepCallbackFilterobjects alive to enable caching of generated classes. Prefer usingstaticclasses for implementation ofCallbackFilter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intaccept(java.lang.reflect.Method method)Map a method to a callback.booleanequals(java.lang.Object o)TheCallbackFilterin use affects which cached class theEnhancerwill use, so this is a reminder that you should correctly implementequalsandhashCodefor customCallbackFilterimplementations in order to improve performance.
-
-
-
Method Detail
-
accept
int accept(java.lang.reflect.Method method)
Map a method to a callback.- Parameters:
method- the intercepted method- Returns:
- 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)
TheCallbackFilterin use affects which cached class theEnhancerwill use, so this is a reminder that you should correctly implementequalsandhashCodefor customCallbackFilterimplementations in order to improve performance.- Overrides:
equalsin classjava.lang.Object
-
-