T - The data signature classV - The event data classpublic class DataHandlerCounter<T,V extends EventData<T>> extends EventCounter implements Closeable
EventDataHandler.
Registers shutdown hook and thread for triggering event processing after wait time.| Constructor and Description |
|---|
DataHandlerCounter(EventDataHandler<T,V> dataHandler)
Create an instance with provided data handler and
UnknownContext.PERMISSIVE
fallback context. |
DataHandlerCounter(EventDataHandler<T,V> dataHandler,
IContext fallback)
Create an instance with provided data handler and fallback context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Disable all registered hooks and process the left data.
|
protected void |
onEvent(IEvent event,
IMetaInfo metaInfo)
Process the event.
|
public DataHandlerCounter(EventDataHandler<T,V> dataHandler)
UnknownContext.PERMISSIVE
fallback context.dataHandler - the EventDataHandler for events handlingpublic DataHandlerCounter(EventDataHandler<T,V> dataHandler, IContext fallback)
dataHandler - the EventDataHandler for events handlingfallback - the fallback contextprotected void onEvent(IEvent event, IMetaInfo metaInfo)
onEvent in class EventCounterevent - IEvent to countmetaInfo - the IMetaInfo that can hold information about event originIllegalStateException - if the current instance has been disabled.
See close()public void close()
onEvent(IEvent, IMetaInfo) method would throw
an exception.close in interface Closeableclose in interface AutoCloseableCopyright © 1998–2021 iText Group NV. All rights reserved.