Ranides Atterwim 10 years ago
parent
commit
606488b8f2
1 changed files with 35 additions and 0 deletions
  1. 35 0
      assira/src/main/java/net/ranides/assira/events/EventHandler.java

+ 35 - 0
assira/src/main/java/net/ranides/assira/events/EventHandler.java

@@ -0,0 +1,35 @@
+/*
+ * @author Ranides Atterwim <ranides@gmail.com>
+ * @copyright Ranides Atterwim
+ * @license WTFPL
+ * @url http://ranides.net/projects/assira
+ */
+package net.ranides.assira.events;
+
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ *
+ * @author Ranides Atterwim <ranides@gmail.com>
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+@Documented
+public @interface EventHandler {
+    
+    Class<?> event();
+    
+    String router() default "awt!250";
+    
+    class Helolo {
+    
+        @EventHandler(event=Event.class)
+        public void run() { }
+    
+    }
+    
+}