org.mockito.internal.creation
Class MethodInterceptorFilter

java.lang.Object
  extended by org.mockito.internal.creation.MethodInterceptorFilter
All Implemented Interfaces:
java.io.Serializable, Callback, MethodInterceptor

public class MethodInterceptorFilter
extends java.lang.Object
implements MethodInterceptor, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
MethodInterceptorFilter(MockitoInvocationHandler handler, MockSettingsImpl mockSettings)
           
 
Method Summary
 MockitoMethod createMockitoMethod(java.lang.reflect.Method method)
           
 MockitoMethodProxy createMockitoMethodProxy(MethodProxy methodProxy)
           
 MockitoInvocationHandler getHandler()
           
 java.lang.Object intercept(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args, MethodProxy methodProxy)
          All generated proxied methods call this method instead of the original method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodInterceptorFilter

public MethodInterceptorFilter(MockitoInvocationHandler handler,
                               MockSettingsImpl mockSettings)
Method Detail

intercept

public java.lang.Object intercept(java.lang.Object proxy,
                                  java.lang.reflect.Method method,
                                  java.lang.Object[] args,
                                  MethodProxy methodProxy)
                           throws java.lang.Throwable
Description copied from interface: MethodInterceptor
All generated proxied methods call this method instead of the original method. The original method may either be invoked by normal reflection using the Method object, or by using the MethodProxy (faster).

Specified by:
intercept in interface MethodInterceptor
Parameters:
proxy - "this", the enhanced object
method - intercepted Method
args - argument array; primitive types are wrapped
methodProxy - used to invoke super (non-intercepted method); may be called as many times as needed
Returns:
any value compatible with the signature of the proxied method. Method returning void will ignore this value.
Throws:
java.lang.Throwable - any exception may be thrown; if so, super method will not be invoked
See Also:
MethodProxy

getHandler

public MockitoInvocationHandler getHandler()

createMockitoMethodProxy

public MockitoMethodProxy createMockitoMethodProxy(MethodProxy methodProxy)

createMockitoMethod

public MockitoMethod createMockitoMethod(java.lang.reflect.Method method)