netimen
netimen

Reputation: 4419

How to extend annotations in Java?

I'm using Android Annotations library and there is @UIThread annotation, which takes an optional argument propagation. I always use this annotation with REUSE value of this parameter:

@UiThread(propagation = UiThread.Propagation.REUSE)
void doSomething() {
}

So can I make somehow my own annoation @UIThreadReuse which would extend the @UIThread annotation and pass REUSE as a parameter? So I could just write like this:

@UiThreadReuse
void doSomething() {
}

Upvotes: 1

Views: 739

Answers (1)

WonderCsabo
WonderCsabo

Reputation: 12207

This is not possible right now. But in the near future we will support plugins for AndroidAnnotations, so you will be able to add new annotations and corresponding code generators easily.

Upvotes: 2

Related Questions