Top Description Methods
org.easymock.internal

public Interface IProxyFactory

Known Direct Implementers
org.easymock.internal.JavaProxyFactory, org.easymock.internal.AndroidClassProxyFactory, org.easymock.internal.ClassProxyFactory
Imports
org.easymock.ConstructorArgs, java.lang.reflect.InvocationHandler, .Method

Reponsible of creating proxies for objects. The implementation used for an object to proxy depends on its type but also on the JVM we are running.
Author
OFFIS, Tammo Freese

Method Summary

Modifier and TypeMethod and Description
public <
type of the class to mock
T
>
T

Returns:

the newly created proxy
createProxy
(Class<T>
the class to mock by the factory
toMock
,
InvocationHandler
the handler that will be linked to the created proxy
handler
,
Method[]
the subset of toMock's methods to mock, or null to mock all methods.
mockedMethods
,
ConstructorArgs
the constructor arguments to use, or null to use heuristics to choose a constructor.
constructorArgs
)

public InvocationHandler

Returns:

the handler handling method calls for the mock
getInvocationHandler
(Object
a mock instance previously returned by createProxy.
mock
)

Returns the invocation handler for mock;

Method Detail

createProxyback to summary
public <T> T createProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs constructorArgs)
Parameters
<T>
type of the class to mock
toMock:Class<T>

the class to mock by the factory

handler:InvocationHandler

the handler that will be linked to the created proxy

mockedMethods:Method[]

the subset of toMock's methods to mock, or null to mock all methods.

constructorArgs:ConstructorArgs

the constructor arguments to use, or null to use heuristics to choose a constructor.

Returns:T

the newly created proxy

getInvocationHandlerback to summary
public InvocationHandler getInvocationHandler(Object mock)

Returns the invocation handler for mock;

Parameters
mock:Object

a mock instance previously returned by createProxy.

Returns:InvocationHandler

the handler handling method calls for the mock