View Javadoc

1   package cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation;
2   
3   import java.lang.annotation.ElementType;
4   import java.lang.annotation.Retention;
5   import java.lang.annotation.RetentionPolicy;
6   import java.lang.annotation.Target;
7   
8   import cz.cuni.amis.pogamut.base.communication.worldview.IWorldView;
9   
10  /**
11   * Used by {@link AnnotationListenerRegistrator} to register level A listener 
12   * ({@link IWorldView#addEventListener(Class, cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEventListener)} 
13   * for the annotated method. The annotated method must have 1 parameter of {@link EventListener#eventClass()}.
14   * <p><p>
15   * The listeners are created by calling {@link AnnotationListenerRegistrator#addListeners()} and removed by 
16   * calling {@link AnnotationListenerRegistrator#removeListeners()}.
17   * 
18   * @author Jimmy
19   */
20  @Target(value = { ElementType.METHOD })
21  @Retention(value = RetentionPolicy.RUNTIME)
22  public @interface EventListener {
23  	
24  	/**
25  	 * Event you want the method to receive.
26  	 * @return
27  	 * @see IWorldView#addEventListener(Class, cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEventListener)
28  	 */
29  	Class<?> eventClass();
30  }