|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME) @Target(value=METHOD) @Documented public @interface EventListener
Used to annotate event listener methods. Methods should be public and take one parameter which is the event to be handled.
For example, the following class implements a simple event listener: public class TestListener {
@EventListener
public void onEvent(SampleEvent event) {
System.out.println("Handled an event: " + event);
}
}
AnnotatedMethodsListenerHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||