Package org.easymock.internal
Class JavaProxyFactory
- java.lang.Object
-
- org.easymock.internal.JavaProxyFactory
-
- All Implemented Interfaces:
IProxyFactory
public class JavaProxyFactory extends java.lang.Object implements IProxyFactory
- Author:
- OFFIS, Tammo Freese
-
-
Constructor Summary
Constructors Constructor Description JavaProxyFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
createProxy(java.lang.Class<T> toMock, java.lang.reflect.InvocationHandler handler, java.lang.reflect.Method[] mockedMethods, ConstructorArgs constructorArgs)
java.lang.reflect.InvocationHandler
getInvocationHandler(java.lang.Object mock)
Returns the invocation handler formock
;
-
-
-
Method Detail
-
createProxy
public <T> T createProxy(java.lang.Class<T> toMock, java.lang.reflect.InvocationHandler handler, java.lang.reflect.Method[] mockedMethods, ConstructorArgs constructorArgs)
- Specified by:
createProxy
in interfaceIProxyFactory
- Type Parameters:
T
- type of the class to mock- Parameters:
toMock
- the class to mock by the factoryhandler
- the handler that will be linked to the created proxymockedMethods
- the subset oftoMock
's methods to mock, or null to mock all methods.constructorArgs
- the constructor arguments to use, or null to use heuristics to choose a constructor.- Returns:
- the newly created proxy
-
getInvocationHandler
public java.lang.reflect.InvocationHandler getInvocationHandler(java.lang.Object mock)
Description copied from interface:IProxyFactory
Returns the invocation handler formock
;- Specified by:
getInvocationHandler
in interfaceIProxyFactory
- Parameters:
mock
- a mock instance previously returned bycreateProxy
.- Returns:
- the handler handling method calls for the
mock
-
-