Package com.itextpdf.kernel.pdf.event
Class AbstractPdfDocumentEventHandler
java.lang.Object
com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEventHandler
- All Implemented Interfaces:
-
IEventHandler
Base class for PDF document events handling based on the event type.
Handles AbstractPdfDocumentEvent event fired by PdfDocument.dispatchEvent(AbstractPdfDocumentEvent). Use PdfDocument.addEventHandler(String, AbstractPdfDocumentEventHandler) to register this handler for specific type of event.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds new event type to handle by thisAbstractPdfDocumentEventHandlerinstance.protected abstract voidHandles the accepted event.voidHandles the event.
-
Constructor Details
-
AbstractPdfDocumentEventHandler
protected AbstractPdfDocumentEventHandler()Creates newAbstractPdfDocumentEventHandlerinstance.By default, this instance handles all types of the
AbstractPdfDocumentEventevents. For specific types handling, useaddType(String)method.
-
-
Method Details
-
addType
Adds new event type to handle by thisAbstractPdfDocumentEventHandlerinstance.- Parameters:
-
type- theAbstractPdfDocumentEventtype to handle - Returns:
-
this
AbstractPdfDocumentEventHandlerinstance
-
onEvent
Description copied from interface:IEventHandlerHandles the event.- Specified by:
-
onEventin interfaceIEventHandler - Parameters:
-
event- to handle
-
onAcceptedEvent
Handles the accepted event.- Parameters:
-
event-AbstractPdfDocumentEventto handle
-