Factory method to create an observable collection using a listener or a handler.
A lot of functionality is available through this method.
If you don't need the extra functionality, simply implement the
org.apache.commons.events.observable.standard.StandardModificationListener interface and pass it in as the second parameter.
Internally, an ObservableCollection relies on a
ModificationHandler .
The handler receives all the events and processes them, typically by
calling listeners. Different handler implementations can be plugged in
to provide a flexible event system.
The handler implementation is determined by the listener parameter via
the registered factories. The listener may be a manually configured
ModificationHandler instance.
The listener is defined as an Object for maximum flexibility.
It does not have to be a listener in the classic JavaBean sense.
It is entirely up to the factory and handler as to how the parameter
is interpretted. An IllegalArgumentException is thrown if no suitable
handler can be found for this listener.
A null listener will create a
StandardModificationHandler .
Parameters: coll - the collection to decorate, must not be null Parameters: listener - collection listener, may be null the observed collection throws: IllegalArgumentException - if the collection is null throws: IllegalArgumentException - if there is no valid handler for the listener |