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
AbstractPdfDocumentEvent
event 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 protected
AbstractPdfDocumentEventHandler()
Creates newAbstractPdfDocumentEventHandler
instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AbstractPdfDocumentEventHandler
addType(java.lang.String type)
Adds new event type to handle by thisAbstractPdfDocumentEventHandler
instance.protected abstract void
onAcceptedEvent(AbstractPdfDocumentEvent event)
Handles the accepted event.void
onEvent(IEvent event)
Handles the event.
-
-
-
Constructor Detail
-
AbstractPdfDocumentEventHandler
protected AbstractPdfDocumentEventHandler()
Creates newAbstractPdfDocumentEventHandler
instance.By default, this instance handles all types of the
AbstractPdfDocumentEvent
events. For specific types handling, useaddType(String)
method.
-
-
Method Detail
-
addType
public AbstractPdfDocumentEventHandler addType(java.lang.String type)
Adds new event type to handle by thisAbstractPdfDocumentEventHandler
instance.- Parameters:
type
- theAbstractPdfDocumentEvent
type to handle- Returns:
- this
AbstractPdfDocumentEventHandler
instance
-
onEvent
public void onEvent(IEvent event)
Description copied from interface:IEventHandler
Handles the event.- Specified by:
onEvent
in interfaceIEventHandler
- Parameters:
event
- to handle
-
onAcceptedEvent
protected abstract void onAcceptedEvent(AbstractPdfDocumentEvent event)
Handles the accepted event.- Parameters:
event
-AbstractPdfDocumentEvent
to handle
-
-