|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EventFilter
Allows writing complex Event matching algorithms for the 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.*"))
| Method Summary | |
|---|---|
java.lang.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. |
| Method Detail |
|---|
java.lang.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 value
true 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||