1

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() {
}
3
  • 1
    Java does not allow to extend annotations, see stackoverflow.com/questions/1624084/… Commented Dec 22, 2014 at 9:31
  • The title is not correct. This is about annotation processing code generation tool, and the OP wants to add a new annotation with a narrowed generation behavior of an existing annotation. Commented Dec 22, 2014 at 9:59
  • or, you could see the composing part of annotations - javacodegeeks.com/2012/12/composing-java-annotations.html Commented Dec 22, 2014 at 9:59

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.