Package com.itextpdf.kernel.pdf.event
Class AbstractPdfDocumentEventHandler
- java.lang.Object
-
- com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEventHandler
-
- All Implemented Interfaces:
IEventHandler
- Direct Known Subclasses:
SignatureMacIntegrityProtector.SignatureMacContainerEmbedder,SignatureMacIntegrityProtector.SignatureMacPdfObjectAdder,StandaloneMacIntegrityProtector.StandaloneMacContainerEmbedder,StandaloneMacIntegrityProtector.StandaloneMacPdfObjectAdder
public abstract class AbstractPdfDocumentEventHandler extends java.lang.Object implements IEventHandler
Base class for PDF document events handling based on the event type.Handles
AbstractPdfDocumentEventevent fired byPdfDocument.dispatchEvent(AbstractPdfDocumentEvent). UsePdfDocument.addEventHandler(String, AbstractPdfDocumentEventHandler)to register this handler for specific type of event.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>types
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPdfDocumentEventHandler()Creates newAbstractPdfDocumentEventHandlerinstance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AbstractPdfDocumentEventHandleraddType(java.lang.String type)Adds new event type to handle by thisAbstractPdfDocumentEventHandlerinstance.protected abstract voidonAcceptedEvent(AbstractPdfDocumentEvent event)Handles the accepted event.voidonEvent(IEvent event)Handles the event.
-
-
-
Constructor Detail
-
AbstractPdfDocumentEventHandler
protected AbstractPdfDocumentEventHandler()
Creates newAbstractPdfDocumentEventHandlerinstance.By default, this instance handles all types of the
AbstractPdfDocumentEventevents. For specific types handling, useaddType(String)method.
-
-
Method Detail
-
addType
public AbstractPdfDocumentEventHandler addType(java.lang.String type)
Adds new event type to handle by thisAbstractPdfDocumentEventHandlerinstance.- Parameters:
type- theAbstractPdfDocumentEventtype to handle- Returns:
- this
AbstractPdfDocumentEventHandlerinstance
-
onEvent
public void onEvent(IEvent event)
Description copied from interface:IEventHandlerHandles the event.- Specified by:
onEventin interfaceIEventHandler- Parameters:
event- to handle
-
onAcceptedEvent
protected abstract void onAcceptedEvent(AbstractPdfDocumentEvent event)
Handles the accepted event.- Parameters:
event-AbstractPdfDocumentEventto handle
-
-