Parameterized Annotation Font @RaiseEvent?

Is it possible to give an annotation parameter @RaiseEvent?

I have an observer

@Observer(value = { MyEvents.MY_EVENT }, create = false)
public void doSomething(String oldValue) {

when using a method call, I can give a parameter with a raise Events.instance().raiseEvent(MyEvents.MY_EVENT, name);. Is it possible to give this parameter with annotation as well? (I just prefer method call annotation)

THX

+3
source share
1 answer

No. Annotation @RaiseEventdoes not support parameters.
If you want to use the parameters, you must programmatically raise the event.

Events.instance().raiseEvent("nameOfObserver",parameters...);
+4
source

All Articles