mirror of
https://github.com/zaaarf/geb.git
synced 2024-11-22 14:44:50 +01:00
chore: moved back the only remaining annotation
This commit is contained in:
parent
4dcb9eca24
commit
0c16dc9ff4
1 changed files with 29 additions and 0 deletions
29
src/main/java/ftbsc/geb/api/annotations/Listen.java
Normal file
29
src/main/java/ftbsc/geb/api/annotations/Listen.java
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
package ftbsc.geb.api.annotations;
|
||||||
|
|
||||||
|
import ftbsc.geb.api.IBus;
|
||||||
|
import ftbsc.geb.api.IEvent;
|
||||||
|
import ftbsc.geb.api.IEventCancelable;
|
||||||
|
import ftbsc.geb.api.IListener;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks the method as a listener. Its parent must implement the {@link IListener} interface
|
||||||
|
* and be registered an at least one GEB instance with {@link IBus#registerListener(IListener)}.
|
||||||
|
* The annotated method should only take a single input value, an instance of {@link IEvent} or
|
||||||
|
* {@link IEventCancelable}.
|
||||||
|
* For the annotation to work, you must be using the GEB annotation processor or an equivalent.
|
||||||
|
* @since 0.1.0
|
||||||
|
*/
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@Retention(RetentionPolicy.CLASS)
|
||||||
|
public @interface Listen {
|
||||||
|
/**
|
||||||
|
* @return an integer indicating priority level for the listener, defaulting to 0;
|
||||||
|
* a higher value means it's executed before; it may be negative
|
||||||
|
*/
|
||||||
|
int priority() default 0;
|
||||||
|
}
|
Loading…
Reference in a new issue