Package org.docx4j.org.apache.fop.events
Interface EventBroadcaster
- All Known Implementing Classes:
DefaultEventBroadcaster
public interface EventBroadcaster
The EventBroadcaster is the central relay point for events. It receives events from various
parts of the application and forwards them to any registered EventListener.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(EventListener listener) Adds an event listener to the broadcaster.voidbroadcastEvent(Event event) Broadcasts an event.<T extends EventProducer>
TgetEventProducerFor(Class<T> clazz) Returns an event producer instance for the given interface class.booleanIndicates whether any listeners have been registered with the broadcaster.voidremoveEventListener(EventListener listener) Removes an event listener from the broadcaster.
-
Method Details
-
addEventListener
Adds an event listener to the broadcaster. It is appended to the list of previously registered listeners (the order of registration defines the calling order).- Parameters:
listener- the listener to be added
-
removeEventListener
Removes an event listener from the broadcaster. If the event listener is not registered, nothing happens.- Parameters:
listener- the listener to be removed
-
hasEventListeners
boolean hasEventListeners()Indicates whether any listeners have been registered with the broadcaster.- Returns:
- true if listeners are present, false otherwise
-
broadcastEvent
Broadcasts an event. This method is usually called from within the observed component.- Parameters:
event- the event to be broadcast
-
getEventProducerFor
Returns an event producer instance for the given interface class.- Parameters:
clazz- the Class object identifying anEventProducerinterface- Returns:
- the event producer instance
-