Is it possible to add constraints in Java Custom Annotations to validate that value is specified for any one of the available attributes?
<p>For example, consider the following annotation.</p>

<p><strong>Here both value &amp; name attributes are mandatory.</strong></p>

<pre><code>    @Target(ElementType.METHOD)
    @Retention(RetentionPolicy.RUNTIME)
    public @interface TestAnnotation {
       String value();
       String name();
    }
</code></pre>

<p><strong>But is it possible to throw compilation error while using this annotation, when either name or value is not specified ?</strong></p>