资 源 简 介
Annotation-driven event framework for Java
Usage
Short Example
```
public class SomeController {
private Calculator c = new Calculator();
public SomeController() {
c.eventHelper.registerReceiver(this);
c.add(10, 10);
}
@EventReceiver
public void onResult(Long result) {
System.out.println("Calculator got: " + result);
}
}
public class Calculator {
EventHelper eventHelper = new EventHelper(this);
public void add(long a, long b) {
eventHelper.fireEvent(new Long(a + b));
}
}
```
Longer Example
```
public class SomeController {
private Calculator c1 = new Calculator();
private Calculator c2 = new Calculator();
public SomeController() {
c1.registerReceiver(this);
c2.registerReceiver(this);
c1.add(10, 10);
c2.add(20, 20);
}
@EventReceiver(handleFor="c1")
public void onResultC1(Calculator.Event