org.ow2.bonita.util
Class Chainer<T>
java.lang.Object
org.ow2.bonita.util.Chainer<T>
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler
public class Chainer<T>
- extends java.lang.Object
- implements java.lang.reflect.InvocationHandler
Generic chainer.
This InvocationHandler
allows chaining of void only
method invocations.
If an exception is raised during the invocation of a void
method in the chain, then the forwarding is stopped, and the exception will
be raised up.
Note that if a non-void method is invoked, an
IllegalArgumentException
is thrown.
- Author:
- Pierre Vigneras
Method Summary |
void |
add(int i,
T element)
|
void |
add(T element)
|
boolean |
contains(T element)
|
T |
get(int i)
|
java.util.List<T> |
getAsList()
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
T |
remove(int i)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Chainer
public Chainer()
add
public void add(T element)
add
public void add(int i,
T element)
remove
public T remove(int i)
get
public T get(int i)
contains
public boolean contains(T element)
getAsList
public java.util.List<T> getAsList()
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- Specified by:
invoke
in interface java.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
Copyright © 2009 OW2 Consortium. All Rights Reserved.