public class MultipleInheritanceProxy extends Object implements InvocationHandler
DelegatorProxy.| Modifier | Constructor and Description |
|---|---|
protected |
MultipleInheritanceProxy()
Constructor
|
protected |
MultipleInheritanceProxy(Collection<Object> delegates)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
createEnhancedPresenter(Object instanceToEnhance,
Object extendedImplementation,
Class<T> cast,
ClassLoader classLoader)
combines two instances into one.
|
static Object |
createMultipleInheritance(Class[] interfazes,
Collection delegates,
ClassLoader classLoader)
creates a new proxy instance with BeanProxy as invocationhandler.
|
protected static Collection<Class> |
getAllInterfaces(Class<?> cls)
getAllInterfaces
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
the first implementing delegate collection member will be used to invoke the given method.
|
String |
toString()
toString
|
protected MultipleInheritanceProxy()
protected MultipleInheritanceProxy(Collection<Object> delegates)
delegates - see delegatespublic static Object createMultipleInheritance(Class[] interfazes, Collection delegates, ClassLoader classLoader)
interfazes - interfaces to implementdelegates - implementation instances. the order is important!classloader - classloader to use the interfaces and instancespublic static final <T> T createEnhancedPresenter(Object instanceToEnhance, Object extendedImplementation, Class<T> cast, ClassLoader classLoader)
instanceToEnhance - object to enhance with functionality of extendedImplementationextendedImplementation - object to be used as enhancer.cast - interface to be returnedprotected static Collection<Class> getAllInterfaces(Class<?> cls)
cls - clazz to evaluatepublic Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowableInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])public String toString()
toString in class ObjectObject.toString()Copyright © 2012–2018. All rights reserved.