public class AnnotationEventListenerResolver extends Object implements EventListenerResolver
EventListener
instance for each method
discovered. An event bus will call the resulting listeners as relevant events arrive.
The default annotationClass
is Subscribe
, indicating each
Subscribe
-annotated method will be represented as an EventListener.SingleArgumentMethodEventListener
Constructor and Description |
---|
AnnotationEventListenerResolver() |
Modifier and Type | Method and Description |
---|---|
Class<? extends Annotation> |
getAnnotationClass()
Returns the type of annotation that indicates a method that should be represented as an
EventListener ,
defaults to Subscribe . |
List<EventListener> |
getEventListeners(Object instance)
Returns a new collection of
EventListener instances, each instance corresponding to an annotated
method discovered on the specified instance argument. |
void |
setAnnotationClass(Class<? extends Annotation> annotationClass)
Sets the type of annotation that indicates a method that should be represented as an
EventListener . |
public AnnotationEventListenerResolver()
public List<EventListener> getEventListeners(Object instance)
EventListener
instances, each instance corresponding to an annotated
method discovered on the specified instance
argument.getEventListeners
in interface EventListenerResolver
instance
- the instance to inspect for annotated event handler methods.EventListener
instances, each instance corresponding to an annotated
method discovered on the specified instance
argument.public Class<? extends Annotation> getAnnotationClass()
EventListener
,
defaults to Subscribe
.EventListener
,
defaults to Subscribe
.public void setAnnotationClass(Class<? extends Annotation> annotationClass)
EventListener
.
The default value is Subscribe
.annotationClass
- the type of annotation that indicates a method that should be represented as an
EventListener
. The default value is Subscribe
.Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.