org.omnaest.utils.proxy
Class StubCreator

java.lang.Object
  extended by org.omnaest.utils.proxy.StubCreator

public class StubCreator
extends Object

Simple stub creator.

Author:
Omnaest

Nested Class Summary
static interface StubCreator.MethodInvocationHandler
          Handles a method invocation.
 
Constructor Summary
StubCreator()
           
 
Method Summary
static
<E> E
newStubInstance(Class<? extends E> clazz, Class<?>[] interfaces, net.sf.cglib.proxy.MethodInterceptor methodInterceptor)
          Returns a new proxy stub for the given class or interface but takes additional interfaces.
static
<E> E
newStubInstance(Class<? extends E> clazz, Class<?>[] interfaces, StubCreator.MethodInvocationHandler methodInvocationHandler)
          Same as newStubInstance(Class, Class[], MethodInterceptor) but uses a StubCreator.MethodInvocationHandler instead.
static
<E> E
newStubInstance(Class<? extends E> clazz, net.sf.cglib.proxy.MethodInterceptor methodInterceptor)
           
static
<E> E
newStubInstance(Class<? extends E> clazz, StubCreator.MethodInvocationHandler methodInvocationHandler)
          Returns a new proxy stub for the given class or interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StubCreator

public StubCreator()
Method Detail

newStubInstance

public static <E> E newStubInstance(Class<? extends E> clazz,
                                    StubCreator.MethodInvocationHandler methodInvocationHandler)
Returns a new proxy stub for the given class or interface.

Type Parameters:
E -
Parameters:
clazz -
methodInvocationHandler -
Returns:

newStubInstance

public static <E> E newStubInstance(Class<? extends E> clazz,
                                    net.sf.cglib.proxy.MethodInterceptor methodInterceptor)

newStubInstance

public static <E> E newStubInstance(Class<? extends E> clazz,
                                    Class<?>[] interfaces,
                                    StubCreator.MethodInvocationHandler methodInvocationHandler)
Same as newStubInstance(Class, Class[], MethodInterceptor) but uses a StubCreator.MethodInvocationHandler instead.

Type Parameters:
E -
Parameters:
clazz -
interfaces -
methodInvocationHandler -
Returns:

newStubInstance

public static <E> E newStubInstance(Class<? extends E> clazz,
                                    Class<?>[] interfaces,
                                    net.sf.cglib.proxy.MethodInterceptor methodInterceptor)
Returns a new proxy stub for the given class or interface but takes additional interfaces.

Type Parameters:
E -
Parameters:
clazz -
interfaces -
methodInterceptor -
Returns:


Copyright © 2011. All Rights Reserved.