In my project I use pre-defined annotation @With
:
@With(Secure.class)
public class Test { //....
The source code of @With
:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface With {
Class<?>[] value() default {};
}
I want to write custom annotation @Secure
, which will have the same effect as @With(Secure.class)
. How to do that?
What if I do like this? Will it work?
@With(Secure.class)
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Secure {
}