I'm creating a custom annotation named @Skip as shown below.
@Retention (RetentionPolicy.RUNTIME)
@Target ({ElementType.TYPE, ElementType.METHOD})
@Inherited
public @interface Skip {
public String comment() default "";
public String bug() default "";
}
Is it possible to set conditional default value on the comment and bug? What I'm trying to achieve is, if comment is provided, bug must be optional, if bug is provided comment is optional. I can do this check at run-time, but I want to find out if we can do it at compile time. This way, eclipse will show a compilation error if at least one of these is not provided by the developer.