M'hamed
M'hamed

Reputation: 2598

annotation represent another annotation

Is it possible to have an custom annotation that do the same work as another annotation ?

For example if I write @MyCustomAnnotation like I have write @override !

Upvotes: 7

Views: 1598

Answers (1)

Jason Dunkelberger
Jason Dunkelberger

Reputation: 1252

There's definitely no support for inheritance with Annotations. See: Is there something like Annotation Inheritance in java?

So without that, unless some framework chose to provide extensibility around its annotation processing, you would have a lot of trouble achieving such an effect.

Upvotes: 1

Related Questions