public class DelegatorProxy extends Object implements InvocationHandler, Serializable
example:
public void setBeanFinder(final IBeanFinder beanFinder) {
Object internalBeanFinder = new Object() {
Collection getData(T from, Object to) {
collection = (COLLECTIONTYPE) beanFinder.getData(from, to);
return collection;
};
};
this.beanFinder = DelegatorProxy.delegator(IBeanFinder.class, internalBeanFinder, beanFinder);
}
To work directly on interface implementations, use MultipleInheritanceProxy.| Modifier | Constructor and Description |
|---|---|
protected |
DelegatorProxy(Object... delegators) |
| Modifier and Type | Method and Description |
|---|---|
static Object |
delegator(Class[] proxyInterfaces,
Object... delegators)
delegator
|
static <T> T |
delegator(Class<T> proxyInterface,
Object... delegators)
delegator
|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
protected DelegatorProxy(Object... delegators)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowablepublic static final <T> T delegator(Class<T> proxyInterface, Object... delegators)
T - proxyInterface - delegators - Copyright © 2012–2018. All rights reserved.