Package org.springframework.cglib.proxy
Interface Factory
public interface Factory
All enhanced instances returned by the 
Enhancer class implement this interface.
 Using this interface for new instances is faster than going through the Enhancer
 interface or using reflection. In addition, to intercept methods called during
 object construction you must use these methods instead of reflection.- Author:
- Juozas Baliuka [email protected]
- 
Method SummaryModifier and TypeMethodDescriptiongetCallback(int index) Return theCallbackimplementation at the specified index.Callback[]Get the current set of callbacks for ths object.newInstance(Class[] types, Object[] args, Callback[] callbacks) Creates a new instance of the same type, using the constructor matching the given signature.newInstance(Callback callback) Creates new instance of the same type, using the no-arg constructor.newInstance(Callback[] callbacks) Creates new instance of the same type, using the no-arg constructor.voidsetCallback(int index, Callback callback) Set the callback for this object for the given type.voidsetCallbacks(Callback[] callbacks) Replace all of the callbacks for this object at once.
- 
Method Details- 
newInstanceCreates new instance of the same type, using the no-arg constructor. The class of this object must have been created using a single Callback type. If multiple callbacks are required an exception will be thrown.- Parameters:
- callback- the new interceptor to use
- Returns:
- new instance of the same type
 
- 
newInstanceCreates new instance of the same type, using the no-arg constructor.- Parameters:
- callbacks- the new callbacks(s) to use
- Returns:
- new instance of the same type
 
- 
newInstanceCreates a new instance of the same type, using the constructor matching the given signature.- Parameters:
- types- the constructor argument types
- args- the constructor arguments
- callbacks- the new interceptor(s) to use
- Returns:
- new instance of the same type
 
- 
getCallbackReturn theCallbackimplementation at the specified index.- Parameters:
- index- the callback index
- Returns:
- the callback implementation
 
- 
setCallbackSet the callback for this object for the given type.- Parameters:
- index- the callback index to replace
- callback- the new callback
 
- 
setCallbacksReplace all of the callbacks for this object at once.- Parameters:
- callbacks- the new callbacks(s) to use
 
- 
getCallbacksCallback[] getCallbacks()Get the current set of callbacks for ths object.- Returns:
- a new array instance
 
 
-