Listener-Level Properties #13
| @@ -1,6 +1,6 @@ | |||||||
| package dev.kske.eventbus.core; | package dev.kske.eventbus.core; | ||||||
|  |  | ||||||
| import static java.lang.annotation.ElementType.METHOD; | import static java.lang.annotation.ElementType.*; | ||||||
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||||||
|  |  | ||||||
| import java.lang.annotation.*; | import java.lang.annotation.*; | ||||||
| @@ -8,6 +8,9 @@ import java.lang.annotation.*; | |||||||
| /** | /** | ||||||
|  * Allows an event handler to receive events that are subtypes of the declared event type. |  * Allows an event handler to receive events that are subtypes of the declared event type. | ||||||
|  * <p> |  * <p> | ||||||
|  |  * When used on a type, the value applies to all event handlers declared within that type that don't | ||||||
|  |  * define a value on their own. | ||||||
|  |  * <p> | ||||||
|  * This is useful when defining an event handler for an interface or an abstract class. |  * This is useful when defining an event handler for an interface or an abstract class. | ||||||
|  * |  * | ||||||
|  * @author Kai S. K. Engelbart |  * @author Kai S. K. Engelbart | ||||||
| @@ -16,5 +19,12 @@ import java.lang.annotation.*; | |||||||
|  */ |  */ | ||||||
| @Documented | @Documented | ||||||
| @Retention(RUNTIME) | @Retention(RUNTIME) | ||||||
| @Target(METHOD) | @Target({ METHOD, TYPE }) | ||||||
| public @interface Polymorphic {} | public @interface Polymorphic { | ||||||
|  |  | ||||||
|  | 	/** | ||||||
|  | 	 * @return whether the event handler is polymorphic | ||||||
|  | 	 * @since 1.1.0 | ||||||
|  | 	 */ | ||||||
|  | 	boolean value() default true; | ||||||
|  | } | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| package dev.kske.eventbus.core; | package dev.kske.eventbus.core; | ||||||
|  |  | ||||||
| import static java.lang.annotation.ElementType.METHOD; | import static java.lang.annotation.ElementType.*; | ||||||
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||||||
|  |  | ||||||
| import java.lang.annotation.*; | import java.lang.annotation.*; | ||||||
| @@ -9,6 +9,9 @@ import java.lang.annotation.*; | |||||||
|  * Defines the priority of an event handler. Handlers are executed in descending order of their |  * Defines the priority of an event handler. Handlers are executed in descending order of their | ||||||
|  * priority. |  * priority. | ||||||
|  * <p> |  * <p> | ||||||
|  |  * When used on a type, the value applies to all event handlers declared within that type that don't | ||||||
|  |  * define a value on their own. | ||||||
|  |  * <p> | ||||||
|  * Handlers without this annotation have the default priority of 100. |  * Handlers without this annotation have the default priority of 100. | ||||||
|  * <p> |  * <p> | ||||||
|  * The execution order of handlers with the same priority is undefined. |  * The execution order of handlers with the same priority is undefined. | ||||||
| @@ -19,7 +22,7 @@ import java.lang.annotation.*; | |||||||
|  */ |  */ | ||||||
| @Documented | @Documented | ||||||
| @Retention(RUNTIME) | @Retention(RUNTIME) | ||||||
| @Target(METHOD) | @Target({ METHOD, TYPE }) | ||||||
| public @interface Priority { | public @interface Priority { | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user