Package org.docx4j.org.apache.fop.events
Class CompositeEventListener
java.lang.Object
org.docx4j.org.apache.fop.events.CompositeEventListener
- All Implemented Interfaces:
EventListener,EventListener
EventListener implementation forwards events to possibly multiple other EventListeners.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(EventListener listener) Adds an event listener to the broadcaster.booleanIndicates whether any listeners have been registered with the broadcaster.voidprocessEvent(Event event) This method is called for each event that is generated.voidremoveEventListener(EventListener listener) Removes an event listener from the broadcaster.
-
Constructor Details
-
CompositeEventListener
public CompositeEventListener()
-
-
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
public boolean hasEventListeners()Indicates whether any listeners have been registered with the broadcaster.- Returns:
- true if listeners are present, false otherwise
-
processEvent
This method is called for each event that is generated. With the event's ID it is possible to react to certain events. Events can also simply be recorded and presented to a user. It is possible to throw an (unchecked) exception if the processing needs to be aborted because some special event occurred. This way the client can configure the behaviour of the observed application.- Specified by:
processEventin interfaceEventListener- Parameters:
event- the event
-