Class ExtensionEventFilter
java.lang.Object
net.sf.basedb.util.extensions.events.ExtensionEventFilter
- All Implemented Interfaces:
EventFilter
Event filter that only passes events for a specific extension.
- Since:
- 3.10
- Author:
- nicklas
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExtensionEventFilter
(String id, EventType eventType) Create a new extension event filter.ExtensionEventFilter
(Extension<?> extension, EventType eventType) Create a new extension event filter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
shouldSend
(EventType event, ExtensionPoint<?> extensionPoint, Extension<?> extension) Determine if the event should be sent to the event handler or not.
-
Field Details
-
id
-
eventType
-
-
Constructor Details
-
ExtensionEventFilter
Create a new extension event filter.- Parameters:
extension
- The extension to pass events foreventType
- The event type to pass events for, or null to pass all event types
-
ExtensionEventFilter
Create a new extension event filter.- Parameters:
id
- The ID of the extension pointeventType
- The event type to pass events for, or null to pass all event types
-
-
Method Details
-
shouldSend
public boolean shouldSend(EventType event, ExtensionPoint<?> extensionPoint, Extension<?> extension) Description copied from interface:EventFilter
Determine if the event should be sent to the event handler or not.- Specified by:
shouldSend
in interfaceEventFilter
- Parameters:
event
- The event that happendextensionPoint
- The extension point that the extension extends, or that the event happened toextension
- The extension the event happend to, or null if the event happended to the extension point- Returns:
- TRUE if the extension has the same ID as the one given in the constructor and if the event type matches
-