|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.GenericEventMulticaster<E>
public final class GenericEventMulticaster<E extends java.util.EventListener>
A generic event multicaster class. The client owns an object of this class,
and calls the fireEvent(java.util.EventObject, freemarker.template.ListenerAdapter)
method to fire events.
Constructor Summary | |
---|---|
GenericEventMulticaster()
Default constructor. |
Method Summary | |
---|---|
void |
addEventListener(E listener)
Adds an event listener. |
void |
fireEvent(java.util.EventObject event,
ListenerAdapter adapter)
Fires an event to all the listeners of this multicaster, using a ListenerAdapter . |
E[] |
getEventListeners()
Gets all the registered event listeners. |
boolean |
isEmpty()
To shortcut event firing: if there's nothing listening, don't bother creating an EventObject . |
void |
removeEventListener(E listener)
Removes an event listener that was previously added. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GenericEventMulticaster()
Method Detail |
---|
public void addEventListener(E listener)
listener
- the event listener to be registeredpublic void removeEventListener(E listener)
listener
- the event listener to be unregisteredpublic E[] getEventListeners()
public boolean isEmpty()
EventObject
.
true
if there are no registered listeners,
otherwise false
public void fireEvent(java.util.EventObject event, ListenerAdapter adapter)
ListenerAdapter
. If any listener throws an exception,
we immediately abort sending the event to any other listeners.
event
- the event to be sent to each of the listenersadapter
- adapts the event listeners to this multicasterListenerAdapter
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |