Package | Description |
---|---|
org.apache.commons.proxy2 | |
org.apache.commons.proxy2.asm | |
org.apache.commons.proxy2.cglib | |
org.apache.commons.proxy2.impl | |
org.apache.commons.proxy2.interceptor | |
org.apache.commons.proxy2.invoker | |
org.apache.commons.proxy2.javassist | |
org.apache.commons.proxy2.jdk | |
org.apache.commons.proxy2.provider | |
org.apache.commons.proxy2.stub |
Contains mechanisms for stubbing behavior on
ProxyFactory -generated proxy objects. |
Modifier and Type | Method and Description |
---|---|
<T> T |
ProxyFactory.createDelegatorProxy(ClassLoader classLoader,
ObjectProvider<?> delegateProvider,
Class<?>... proxyClasses)
Creates a proxy which delegates to the object provided by
delegateProvider . |
<T> T |
ProxyFactory.createDelegatorProxy(ObjectProvider<?> delegateProvider,
Class<?>... proxyClasses)
Creates a proxy which delegates to the object provided by
delegateProvider . |
Modifier and Type | Method and Description |
---|---|
<T> T |
ASMProxyFactory.createDelegatorProxy(ClassLoader classLoader,
ObjectProvider<?> delegateProvider,
Class<?>... proxyClasses) |
Modifier and Type | Method and Description |
---|---|
<T> T |
CglibProxyFactory.createDelegatorProxy(ClassLoader classLoader,
ObjectProvider<?> targetProvider,
Class<?>... proxyClasses)
Creates a proxy which delegates to the object provided by
delegateProvider . |
Modifier and Type | Method and Description |
---|---|
<T> T |
AbstractProxyFactory.createDelegatorProxy(ObjectProvider<?> delegateProvider,
Class<?>... proxyClasses)
Creates a proxy which delegates to the object provided by
delegateProvider . |
Modifier and Type | Method and Description |
---|---|
static Interceptor |
InterceptorUtils.provider(ObjectProvider<?> provider)
Creates an
Interceptor which returns the resulting object from an object provider (for all methods). |
static Interceptor |
InterceptorUtils.throwing(ObjectProvider<? extends Exception> provider)
Creates an
Interceptor which throws the exception provided by an object provider (for all methods). |
Constructor and Description |
---|
ObjectProviderInterceptor(ObjectProvider<?> provider) |
ThrowingInterceptor(ObjectProvider<? extends Exception> provider) |
Constructor and Description |
---|
DelegatingInvoker(ObjectProvider<? extends T> delegateProvider) |
DuckTypingInvoker(ObjectProvider<?> targetProvider)
Create a new DuckTypingInvoker instance.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
JavassistProxyFactory.createDelegatorProxy(ClassLoader classLoader,
ObjectProvider<?> targetProvider,
Class<?>... proxyClasses)
Creates a proxy which delegates to the object provided by
delegateProvider . |
Modifier and Type | Method and Description |
---|---|
<T> T |
JdkProxyFactory.createDelegatorProxy(ClassLoader classLoader,
ObjectProvider<?> delegateProvider,
Class<?>... proxyClasses)
Creates a proxy2 which delegates to the object provided by
delegateProvider . |
Modifier and Type | Class and Description |
---|---|
class |
BeanProvider<T>
Uses
Class.newInstance() to instantiate an object. |
class |
CloningProvider<T extends Cloneable>
Merely calls
clone() (reflectively) on the given Cloneable object. |
class |
ConstantProvider<T>
Always returns the same object.
|
class |
NullProvider<T>
Always returns null.
|
class |
ProviderDecorator<T>
Returns the result of the inner
provider . |
class |
SingletonProvider<T>
Wraps another object provider, making sure to only call it once, returning the value returned from the wrapped
provider on all subsequent invocations.
|
Modifier and Type | Method and Description |
---|---|
static <T> ObjectProvider<T> |
ObjectProviderUtils.bean(Class<T> beanClass) |
static <T extends Cloneable> |
ObjectProviderUtils.cloning(T prototype) |
static <T> ObjectProvider<T> |
ObjectProviderUtils.constant(T value) |
protected ObjectProvider<? extends T> |
ProviderDecorator.getInner() |
static <T> ObjectProvider<T> |
ObjectProviderUtils.nullValue() |
static <T> ObjectProvider<T> |
ObjectProviderUtils.singleton(ObjectProvider<T> inner) |
Modifier and Type | Method and Description |
---|---|
void |
ProviderDecorator.setInner(ObjectProvider<? extends T> inner) |
static <T> ObjectProvider<T> |
ObjectProviderUtils.singleton(ObjectProvider<T> inner) |
Constructor and Description |
---|
ProviderDecorator(ObjectProvider<? extends T> inner)
Create a new ProviderDecorator instance.
|
SingletonProvider(ObjectProvider<? extends T> inner)
Create a new SingletonProvider instance.
|
Modifier and Type | Method and Description |
---|---|
static <A extends Annotation> |
AnnotationBuilder.of(Class<A> type,
ObjectProvider<? extends A> provider) |
S |
BaseTrainer.BaseWhen.thenAnswer(ObjectProvider<? extends R> provider) |
protected void |
BaseTrainer.thenThrow(ObjectProvider<? extends Exception> provider) |
S |
BaseTrainer.BaseWhen.thenThrow(ObjectProvider<? extends Exception> provider) |
Constructor and Description |
---|
StubBuilder(ProxyFactory proxyFactory,
Class<T> type,
ObjectProvider<? extends T> provider) |
Copyright © 2005–2014 The Apache Software Foundation. All rights reserved.