|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.lang.reflect.FusionInvoker
public class FusionInvoker
The fusion invocation handler. It is used to fuse two or more instance into one object. It is usefully if you want to have a single object to represent two more other instances.
Example:
public interface IA {
public void f();
}
public interface IB {
public void g();
}
public class A implements IA {
public void f() {...}
}
public class B implements IB {
public void g() {...}
}
Then, you could fuse them together as follows:
Object obj = FusionInvoker.newInstance(new Object[] {new A(), new B()});
Thus, the fused proxy object, obj, could be used as if
it implements IA and IB:
IA ia = (IA) obj;
ia.f();
IB ib = (IB) obj;
ib.g();
| Constructor Summary | |
|---|---|
protected |
FusionInvoker(Object[] targets)
Use newInstance(Object[]) instead. |
| Method Summary | |
|---|---|
Object |
invoke(Object proxy,
Method method,
Object[] args)
|
static Object |
newInstance(Object[] targets)
Creates an object that contains the all interfaces by wrapping giving object, targets. |
static Object |
newInstance(Object target1,
Object target2)
Use for only two object, see newInstance(Object[]). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected FusionInvoker(Object[] targets)
newInstance(Object[]) instead.
| Method Detail |
|---|
public static Object newInstance(Object target1,
Object target2)
newInstance(Object[]).
public static Object newInstance(Object[] targets)
Usage shortcut: FusionInvoker.newInstance(new Object[] { Object a, Object b });
targets - the objects need to wrapped
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
invoke in interface InvocationHandlerThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||