Top Description Constructors Methods
org.easymock.internal

public Class JavaProxyFactory

extends Object
implements IProxyFactory
Class Inheritance
All Implemented Interfaces
org.easymock.internal.IProxyFactory
Imports
java.lang.reflect.InvocationHandler, .Method, .Proxy, org.easymock.ConstructorArgs

Proxy factory creating proxies from an interface using the standard JDK proxy API.
Author
OFFIS, Tammo Freese

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> T
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
)

Implements org.easymock.internal.IProxyFactory.createProxy.

public InvocationHandler
getInvocationHandler(Object
a mock instance previously returned by createProxy.
mock
)

Implements org.easymock.internal.IProxyFactory.getInvocationHandler.

Returns the invocation handler for mock;
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JavaProxyFactoryback to summary
public JavaProxyFactory()

Method Detail

createProxyback to summary
public <T> T createProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs constructorArgs)

Implements org.easymock.internal.IProxyFactory.createProxy.

Parameters
<T>

Doc from org.easymock.internal.IProxyFactory.createProxy. type of the class to mock

toMock:Class<T>

Doc from org.easymock.internal.IProxyFactory.createProxy.

the class to mock by the factory

handler:InvocationHandler

Doc from org.easymock.internal.IProxyFactory.createProxy.

the handler that will be linked to the created proxy

mockedMethods:Method[]

Doc from org.easymock.internal.IProxyFactory.createProxy.

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

constructorArgs:ConstructorArgs

Doc from org.easymock.internal.IProxyFactory.createProxy.

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

Returns:T

Doc from org.easymock.internal.IProxyFactory.createProxy.

the newly created proxy

Annotations
@SuppressWarnings:unchecked
getInvocationHandlerback to summary
public InvocationHandler getInvocationHandler(Object mock)

Implements org.easymock.internal.IProxyFactory.getInvocationHandler.

Doc from org.easymock.internal.IProxyFactory.getInvocationHandler.

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