java.lang.Object
org.apache.wicket.util.listener.ListenerCollection<T>
- Type Parameters:
T- type of listeners
- All Implemented Interfaces:
Serializable,Iterable<T>
- Direct Known Subclasses:
ChangeListenerSet
Represents a collection of listeners. Facilitates invocation of events on each listener.
Listeners will be invoked in the order added to the collection when using
notify(INotifier) or in reversed order when using reversedNotify(INotifier).
- Author:
- ivaynberg (Igor Vaynberg), Jonathan Locke
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceUsed to notify a listener. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a listener to this set of listeners.protected booleanWhether or not added listeners should be checked for duplicates.protected booleanWhether or not to allownulls in listener collection.iterator()Returns an iterator that can iterate the listeners.protected voidnotify(ListenerCollection.INotifier<T> notifier) Notifies each listener in thisprotected voidNotifies each listener in this set ignoring exceptions.voidRemoves a listener from this set.protected voidreversedNotify(ListenerCollection.INotifier<T> notifier) Notifies each listener in this in reversed orderprotected voidNotifies each listener in this set in reverse order ignoring exceptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ListenerCollection
public ListenerCollection()
-
-
Method Details
-
add
Adds a listener to this set of listeners.- Parameters:
listener- The listener to add- Returns:
trueif the listener was added
-
notify
Notifies each listener in this- Parameters:
notifier- notifier used to notify each listener
-
notifyIgnoringExceptions
Notifies each listener in this set ignoring exceptions. Exceptions will be logged.- Parameters:
notifier- notifier used to notify each listener
-
reversedNotifyIgnoringExceptions
Notifies each listener in this set in reverse order ignoring exceptions- Parameters:
notifier- notifier used to notify each listener
-
reversedNotify
Notifies each listener in this in reversed order- Parameters:
notifier- notifier used to notify each listener
-
remove
Removes a listener from this set.- Parameters:
listener- The listener to remove
-
isAllowingDuplicates
Whether or not added listeners should be checked for duplicates.- Returns:
trueto ignore duplicates
-
isAllowingNulls
Whether or not to allownulls in listener collection.- Returns:
- true to allow nulls to be added to the collection
-
iterator
Returns an iterator that can iterate the listeners.
-