|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
Callback |
getCallback(int index)
Return the Callback implementation at the specified index. |
java.lang.Object |
newInstance()
Creates new instance of the same type, using the no-arg contructor, and copying the callbacks from the existing instance. |
java.lang.Object |
newInstance(Callback callback)
Creates new instance of the same type, using the no-arg constructor. |
java.lang.Object |
newInstance(Callback[] callbacks)
Creates new instance of the same type, using the no-arg constructor. |
java.lang.Object |
newInstance(java.lang.Class[] type,
java.lang.Object[] args)
Creates a new instance of the same type, using the constructor matching the given signature, and copying the callbacks from the existing instance. |
java.lang.Object |
newInstance(java.lang.Class[] types,
java.lang.Object[] args,
Callback[] callbacks)
Creates a new instance of the same type, using the constructor matching the given signature. |
void |
setCallback(int index,
Callback callback)
Set the callback for this object for the given type. |
void |
setCallbacks(Callback[] callbacks)
Replace all of the callbacks for this object at once. |
Method Detail |
public java.lang.Object newInstance()
public java.lang.Object newInstance(Callback callback)
callback
- the new interceptor to use
public java.lang.Object newInstance(Callback[] callbacks)
callbacks
- the new callbacks(s) to use
public java.lang.Object newInstance(java.lang.Class[] type, java.lang.Object[] args)
args
- the constructor arguments
public java.lang.Object newInstance(java.lang.Class[] types, java.lang.Object[] args, Callback[] callbacks)
types
- the constructor argument typesargs
- the constructor argumentscallbacks
- the new interceptor(s) to use
public Callback getCallback(int index)
Callback
implementation at the specified index.
index
- the callback index
public void setCallback(int index, Callback callback)
index
- the callback index to replacecallback
- the new callbackpublic void setCallbacks(Callback[] callbacks)
callbacks
- the new callbacks(s) to use
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |