public interface EventFilter
Event.matches(Object)
method.
For example, this allows writing RegexEventFilter
that can be used to
easily match several documents at once. The following will match all Documents which are saved which have a name
matching the .*Doc.*
regex:
new DocumentSaveEvent(new RegexEventFilter(".*Doc.*"))
Modifier and Type | Method and Description |
---|---|
String |
getFilter()
Provides access to the filter's criterion.
|
boolean |
matches(EventFilter eventFilter)
Compares two event filters to see if they match, meaning that the "contexts" of two events are
compatible.
|
String getFilter()
matches(EventFilter)
method to verify if a passed event filter matches
it.matches(EventFilter)
boolean matches(EventFilter eventFilter)
FixedNameEventFilter
matches another filter only if they both have the same
name set as the filter, while an AlwaysMatchingEventFilter
matches any other event filter. A listener
that registered to receive notifications like referenceEvent
and with
referenceEventFilter
, will be notified of any occuring event for which
referenceEvent.matches(occuringEvent)
will return true
and
referenceEvent.getEventFilter().matches(occurringEvent.getEventFilter())
.eventFilter
- the event filter to compare to the filter valuetrue
if both event filters match. The matching algorithm is left to the filter event
implementation. For example the Regex event filter
will match another filter if
that other filter matches the regex.Copyright © 2004–2019 XWiki. All rights reserved.