com.ekuefler.supereventbus.filtering
Interface EventFilter<H,E>

Type Parameters:
H - type of the class containing the event handler method. This can be a general type like Object, in which case the filter can be applied in any class.
E - type of event to which the filter applies. This can be a general type like Object, in which can the filter can be applied to any handler method.

public interface EventFilter<H,E>

A filter capable of preventing an event handler method from receiving events. Filters are applied to event handlers using then When annotation. Filtering can be done based on the class containing the event handler, the event itself, or a combination of the two.

Note that all event handlers MUST define a zero-argument public constructor.

Author:
ekuefler@gmail.com (Erik Kuefler)

Method Summary
 boolean accepts(H handler, E event)
          Returns whether or not the given handler's Subscribe method should be invoked for the given event.
 

Method Detail

accepts

boolean accepts(H handler,
                E event)
Returns whether or not the given handler's Subscribe method should be invoked for the given event. If this method returns false, the underlying event handler will never be called.

Parameters:
handler - class containing the Subscribe- annotated method to which the event is about to be dispatched
event - event currently being dispatched
Returns:
true to allow the method to handle the event, false to prevent it


Copyright © 2013. All Rights Reserved.