Skip to content

Instantly share code, notes, and snippets.

@firexel
Created April 25, 2012 13:52
Show Gist options
  • Save firexel/2489873 to your computer and use it in GitHub Desktop.
Save firexel/2489873 to your computer and use it in GitHub Desktop.
public @interface EventListener {
String value() default "";
}
public class AnnotationClient {
@EventListener(AnnotationDispatcher.EVENT_ADD)
public void onAdd(AnnotationDispatcher.Event event) {
System.out.println("onAdd");
}
@EventListener(AnnotationDispatcher.EVENT_REMOVE)
public void onRemove(AnnotationDispatcher.Event event) {
System.out.println("onRemove");
}
}
public class AnnotationDispatcher {
public static final String EVENT_ADD = "event_add";
public static final String EVENT_REMOVE = "event_remove";
public class Event {
int data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment