In my project I use pre-defined annotation @With:
@With(Secure.class)
public class Test { //....
The source code of @Wit
From Java language specification, Chapter 9.6 Annotation Types:
No extends clause is permitted. (Annotation types implicitly extend
annotation.Annotation.)
So, you can not extend an Annotation. you need to use some other mechanism or create a code that recognize and process your own annotation. Spring allows you to group other Spring's annotation in your own custom annotations. but still, no extending.