Annotation Interface EventListener
An annotation to mark a method in a class as a method listening for an event. An event method must not be static and
take the event the method is listening to as it's first argument. More specific filtering can be done by providing a
specific channel this event listener listens to. The event channel can be specified by when calling the event being
listened to.
If an event listener is taking more than one argument, all other arguments except the event one will be requested
from the parent injection layer. The layer can be given to the specified EventManager#registerListener
methods. By default, the InjectionLayer.ext() layer is used.
All listeners (or in other words, all method annotated with this annotation) specified in a class will get registered
when calling one of the EventManager#registerListener methods.
- Since:
- 4.0
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe channel this event is listening to.Defines the priority of this event.
-
Element Details
-
channel
String channelThe channel this event is listening to. Defaults to * meaning that the listener listens to all channels.- Returns:
- the channel this listener listens to.
- Default:
"*"
-
order
InvocationOrder orderDefines the priority of this event. A lower priority means that the event is called earlier in the chain. A high priority is useful if the listener should set the final result of the event. Defaults to NORMAL.First priority to the last executed:
- FIRST
- EARLY
- NORMAL
- LATE
- LAST
- MONITOR
- Returns:
- the priority of the listener.
- Default:
NORMAL
-