public class FixedNameEventFilter extends Object implements EventFilter, Serializable
EventFilter
that matches exactly one document name.Constructor and Description |
---|
FixedNameEventFilter(String filter)
Constructor initializing this event filter with a document name that should be matched.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
String |
getFilter()
Provides access to the filter's criterion.
|
int |
hashCode() |
boolean |
matches(EventFilter eventFilter)
Compares two event filters to see if they match, meaning that the "contexts" of two events are
compatible.
|
public FixedNameEventFilter(String filter)
filter
- the name of the matched documentpublic String getFilter()
EventFilter
getFilter
in interface EventFilter
EventFilter.matches(EventFilter)
method to verify if a passed event filter matches
it.EventFilter.matches(EventFilter)
public boolean matches(EventFilter 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())
.matches
in interface EventFilter
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–2017 XWiki. All rights reserved.