Class CombiningEventFilter
- java.lang.Object
-
- net.sf.basedb.util.extensions.events.CombiningEventFilter
-
- All Implemented Interfaces:
EventFilter
public class CombiningEventFilter extends Object implements EventFilter
Event filter that only passes on events based on multiple other event filters. Given a collection of event filters, this filter can pass on the event if at least one of the filters in the collection does or if all of them does.- Version:
- 2.8
- Author:
- nicklas
- Last modified
- $Date: 2008-09-11 22:08:14 +0200 (to, 11 sep 2008) $
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
allMustPass
private Collection<EventFilter>
filters
-
Constructor Summary
Constructors Constructor Description CombiningEventFilter(Collection<EventFilter> filters, boolean allMustPass)
Create a new combining event filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldSend(EventType event, ExtensionPoint<?> extensionPoint, Extension<?> extension)
Determine if the event should be sent to the event handler or not.
-
-
-
Field Detail
-
filters
private final Collection<EventFilter> filters
-
allMustPass
private final boolean allMustPass
-
-
Constructor Detail
-
CombiningEventFilter
public CombiningEventFilter(Collection<EventFilter> filters, boolean allMustPass)
Create a new combining event filter. This filter will pass events depending on how many of the other event filters passes the event.- Parameters:
filters
- A collection of event filtersallMustPass
- TRUE if the event must pass all filters to pass this filter, FALSE if the event must pass at least one filter to pass this filter
-
-
Method Detail
-
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 event passes the filters
-
-