|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.unitils.mock.core.proxy.ProxyFactory
public class ProxyFactory
Utility class to create and work with proxy objects.
Constructor Summary | |
---|---|
ProxyFactory()
|
Method Summary | ||
---|---|---|
protected static
|
createEnhancedClass(Class<T> proxiedClass,
Class<?>... implementedInterfaces)
|
|
static
|
createInitializedOrUninitializedInstanceOfType(Class<T> clazz)
Creates an instance of the given type. |
|
protected static
|
createProxy(String mockName,
boolean initialize,
ProxyInvocationHandler invocationHandler,
Class<T> proxiedClass,
Class<?>... implementedInterfaces)
Creates a proxy object for the given type. |
|
static
|
createProxy(String mockName,
ProxyInvocationHandler invocationHandler,
Class<T> proxiedClass,
Class<?>... implementedInterfaces)
Creates a proxy object for the given type. |
|
static
|
createUninitializedInstanceOfType(Class<T> clazz)
Creates an instance of the given type. |
|
static
|
createUninitializedProxy(String mockName,
ProxyInvocationHandler invocationHandler,
Class<T> proxiedClass,
Class<?>... implementedInterfaces)
Creates a proxy object for the given type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProxyFactory()
Method Detail |
---|
public static <T> T createProxy(String mockName, ProxyInvocationHandler invocationHandler, Class<T> proxiedClass, Class<?>... implementedInterfaces)
mockName
- The name of the mock, not nullinvocationHandler
- The handler that will handle the method invocations of the proxy, not null.proxiedClass
- The type to proxy, not nullimplementedInterfaces
- Additional interfaces that the proxy must implement
public static <T> T createUninitializedProxy(String mockName, ProxyInvocationHandler invocationHandler, Class<T> proxiedClass, Class<?>... implementedInterfaces)
mockName
- The name of the mock, not nullinvocationHandler
- The handler that will handle the method invocations of the proxy, not null.proxiedClass
- The type to proxy, not nullimplementedInterfaces
- Additional interfaces that the proxy must implement
protected static <T> T createProxy(String mockName, boolean initialize, ProxyInvocationHandler invocationHandler, Class<T> proxiedClass, Class<?>... implementedInterfaces)
mockName
- The name of the mock, not nullinitialize
- If possible, use the default constructor and initialize all fieldsimplementedInterfaces
- Additional interfaces that the proxy must implementproxiedClass
- The type to proxy, not nullinvocationHandler
- The handler that will handle the method invocations of the proxy, not null.
public static <T> T createInitializedOrUninitializedInstanceOfType(Class<T> clazz)
T
- The type of the instanceclazz
- The class for which an instance is requested
public static <T> T createUninitializedInstanceOfType(Class<T> clazz)
T
- The type of the instanceclazz
- The class for which an instance is requested
protected static <T> Class<T> createEnhancedClass(Class<T> proxiedClass, Class<?>... implementedInterfaces)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |