E - the event typeL - the listener typepublic class SimpleMethodSubscriptionAdapter<E,L> extends java.lang.Object implements MethodSubscriptionAdapter<L>
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleMethodSubscriptionAdapter.SubscriberGenerationException
Exception thrown when a
EventSubscriber cannot be generated for a
Method at runtime. |
| Constructor and Description |
|---|
SimpleMethodSubscriptionAdapter(@NonNull net.kyori.event.EventBus<E> bus,
EventExecutor.Factory<E,L> factory) |
SimpleMethodSubscriptionAdapter(@NonNull net.kyori.event.EventBus<E> bus,
EventExecutor.Factory<E,L> factory,
@NonNull MethodScanner<L> methodScanner) |
| Modifier and Type | Method and Description |
|---|---|
void |
register(L listener)
Registers all methods determined to be
valid
on the listener to receive events. |
void |
unregister(L listener)
Unregisters all methods on a registered
listener. |
public SimpleMethodSubscriptionAdapter(@NonNull net.kyori.event.EventBus<E> bus, EventExecutor.Factory<E,L> factory)
public SimpleMethodSubscriptionAdapter(@NonNull net.kyori.event.EventBus<E> bus, EventExecutor.Factory<E,L> factory, @NonNull MethodScanner<L> methodScanner)
public void register(L listener)
MethodSubscriptionAdaptervalid
on the listener to receive events.register in interface MethodSubscriptionAdapter<L>listener - the listenerpublic void unregister(L listener)
MethodSubscriptionAdapterlistener.unregister in interface MethodSubscriptionAdapter<L>listener - the listener