I use an annotation with complex parameters frequently, e.g.:
@CookieValue(value = SomeClass.SOME_STATIC_FIELD, required = false) UUID cookieValue
Is it possible to define a new name for this annotation, so the above could be replaced like this?
@MyCookieValue UUID cookieValue
I tried the following, based on this: How to extend Java annotation? Unfortunately, the syntax is not correct.
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyCookieValue {
CookieValue cookieValue(value = SomeClass.SOME_STATIC_FIELD, required = false);
}