Package com.itextpdf.commons.actions
Class AbstractContextBasedEventHandler
java.lang.Object
com.itextpdf.commons.actions.AbstractContextBasedEventHandler
- All Implemented Interfaces:
-
IEventHandler
Base class for events handling depending on the context.
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractContextBasedEventHandler
(IContext onUnknownContext) Creates a new instance of the handler with the defined fallback for events within unknown contexts. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Handles the accepted event.final void
Performs context validation and if event is allowed to be processed passes it toonAcceptedEvent(AbstractContextBasedITextEvent)
.
-
Constructor Details
-
AbstractContextBasedEventHandler
Creates a new instance of the handler with the defined fallback for events within unknown contexts.- Parameters:
-
onUnknownContext
- is a fallback for events within unknown context
-
-
Method Details
-
onEvent
Performs context validation and if event is allowed to be processed passes it toonAcceptedEvent(AbstractContextBasedITextEvent)
.- Specified by:
-
onEvent
in interfaceIEventHandler
- Parameters:
-
event
- to handle
-
onAcceptedEvent
Handles the accepted event.- Parameters:
-
event
- to handle
-