public interface EventManager
Client
instance. This
event manager utilizes MBassador, a lightweight event bus.Modifier and Type | Method and Description |
---|---|
void |
callEvent(@NonNull Object event)
Calls an event, triggering any registered methods for the event class.
|
@NonNull Map<Class<? extends Annotation>,FilterProcessor<?,? extends Annotation>> |
getAnnotationFilters()
Gets a map of all registered annotation filters.
|
@NonNull Set<Object> |
getRegisteredEventListeners()
Gets all registered listener objects.
|
<A extends Annotation> |
registerAnnotationFilter(Class<A> annotationClass,
FilterProcessor<?,A> filterProcessor)
Registers an annotation to be used in filtering events if present on
a handler method.
|
void |
registerEventListener(@NonNull Object listener)
Registers annotated with
Handler with sync invocation,
provided they have a single parameter. |
void |
unregisterEventListener(@NonNull Object listener)
Unregisters a listener.
|
void callEvent(@NonNull Object event)
event
- event to callIllegalArgumentException
- for a null event@NonNull Set<Object> getRegisteredEventListeners()
@NonNull Map<Class<? extends Annotation>,FilterProcessor<?,? extends Annotation>> getAnnotationFilters()
<A extends Annotation> void registerAnnotationFilter(Class<A> annotationClass, FilterProcessor<?,A> filterProcessor)
A
- annotation typeannotationClass
- annotation to registerfilterProcessor
- filter processor to process such annotationsvoid registerEventListener(@NonNull Object listener)
Handler
with sync invocation,
provided they have a single parameter. This parameter is the event.listener
- listener in which to register eventsIllegalArgumentException
- for a null listenervoid unregisterEventListener(@NonNull Object listener)
listener
- listener to unregisterIllegalArgumentException
- for a null listenerCopyright © 2013–2021 Kitteh. All rights reserved.