Class Events
java.lang.Object
org.microbean.event.Events
-
Constructor Summary
ConstructorsConstructorDescriptionEvents(EventTypes eventTypes, Qualifiers qualifiers, EventTypeMatcher eventTypeMatcher, EventQualifiersMatcher eventQualifiersMatcher) Creates a newEvents. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfire(TypeMirror typeArgumentSource, List<Attributes> attributes, Object event, ReferencesSelector rs) Delivers ("fires") the suppliedeventto suitableEventListeners.protected voidfire(EventListener<?, ? super Object> el, Object event, ReferencesSelector rs) Delivers ("Fires") the suppliedeventto the suppliedEventListenervia itsEventListener.eventReceived(Object, ReferencesSelector)method.
-
Constructor Details
-
Events
public Events(EventTypes eventTypes, Qualifiers qualifiers, EventTypeMatcher eventTypeMatcher, EventQualifiersMatcher eventQualifiersMatcher) Creates a newEvents.- Parameters:
eventTypes- anEventTypes; must not benullqualifiers- aQualifiers; must not benulleventTypeMatcher- anEventTypeMatcher; must not benulleventQualifiersMatcher- anEventQualifiersMatcher; must not benull- Throws:
NullPointerException- if any argument isnull
-
-
Method Details
-
fire
public final void fire(TypeMirror typeArgumentSource, List<Attributes> attributes, Object event, ReferencesSelector rs) Delivers ("fires") the suppliedeventto suitableEventListeners.A suitable
EventListeneris one whoseEventListener.attributedType()method returns anAttributedType- Parameters:
typeArgumentSource- handwave here about the specified type and type argument substitutionattributes- aListofAttributesqualifying the event; must not benullevent- the event; must not benullrs- aReferencesSelector; used to findEventListener<?, ?>references; must not benull- Throws:
NullPointerException- if any argument isnullIllegalArgumentException- iftypeArgumentSourceis unsuitable- See Also:
-
fire
Delivers ("Fires") the suppliedeventto the suppliedEventListenervia itsEventListener.eventReceived(Object, ReferencesSelector)method.The default implementation of this method behaves as if its body were exactly
el.eventReceived(event, rs).When this method is invoked by the
fire(TypeMirror, List, Object, ReferencesSelector)method, it is guaranteed that the suppliedEventListeneris a suitable one for the suppliedevent.Overrides of this method must not call the
fire(TypeMirror, List, Object, ReferencesSelector)method, or an infinite loop may result.- Parameters:
el- anEventListenerthat has been determined to be suitable for the suppliedevent; must not benullevent- the event to deliver; must not benullrs- aReferencesSelector; must not benull- Throws:
NullPointerException- if any argument isnull
-