Package com.itextpdf.commons.actions
Class AbstractContextBasedEventHandler
java.lang.Object
com.itextpdf.commons.actions.AbstractContextBasedEventHandler
- All Implemented Interfaces:
IEventHandler
- Direct Known Subclasses:
ProductEventHandler
Base class for events handling depending on the context.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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)
.
-
Field Details
-
defaultContext
-
-
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
-