Package dev.adlin.vts4j.event
Interface Listener
public interface Listener
A marker interface used to discover and register event listener classes
within the
EventHandler.
Classes implementing this interface serve as containers for methods annotated
with EventListener. For a method to be successfully registered as an active
subscriber, it must satisfy the following criteria:
- The enclosing class must implement this
Listenerinterface. - The method must be annotated with
EventListener. - The method must be public and non-static.
- The method must accept exactly one parameter which inherits from the
Eventclass.
Example Usage:
public class MyListener implements Listener {
@EventListener(priority = EventPriority.HIGH)
public void onModelLoaded(ModelLoadedEvent event) {
// Handle the event here
}
}
- See Also: