public class AnnotationProcessor extends Object
public class MyAppController {
public MyAppController {
AnnotationProcessor.process(this);//this line can be avoided with a compile-time tool or an Aspect
}
@EventSubscriber
public void onAppStartingEvent(AppStartingEvent appStartingEvent) {
//do something
}
@EventSubscriber
public void onAppClosingEvent(AppClosingEvent appClosingEvent) {
//do something
}
}
... some other place, needed in some cases when the like a window disposal before it's garbage collected ....
AnnotationProcessor.unprocess(this);
This class can be leveraged in outside of source code in other ways in which Annotations are used: Constructor and Description |
---|
AnnotationProcessor() |
Modifier and Type | Method and Description |
---|---|
static void |
process(Object obj)
Add the appropriate subscribers to one or more EventServices for an instance of a class with
EventBus annotations.
|
static void |
unprocess(Object obj)
Remove the appropriate subscribers from one or more EventServices for an instance of a class with
EventBus annotations.
|
protected static final Logger LOG
public static void process(Object obj)
obj
- the instance that may or may not have annotationspublic static void unprocess(Object obj)
obj
- the instance that may or may not have annotationsCopyright © 2013 Bushe Enterprises, Inc.. All Rights Reserved.