You can not.
You need to write code for this (either at the time the application loads, or using apt )
I had the same scenario and created my annotation:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface DependsOn {
Class<? extends Annotation>[] value();
boolean all() default true;
}
and applied it to other annotations, for example:
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = ElementType.TYPE)
@DependsOn(value={Override.class})
public @interface CustomAnnotation {
}
Imporant: , @Override (SOURCE), .