<p class="p1">&quot;Any class or package may be prevented from providing bean definitions based on the availability of other classes by adding the <span class="s1">@Requires </span>annotation on the class or package.&quot;</p>
<p class="p1">







</p><p class="p1">@Requires({Customer.class, Supplier.class}) public class Order { ...</p>
<p class="p1">}</p><p></p><p class="p1"><br></p><p class="p1">Spring has something similar called @Required with some different behavior. But now that I think on it... it is different enough....</p><p class="p1">I&#39;d prefer explicit names for these annotations. @ExcludeFromCDI and @ ExcludeFromCDIIfMissing.</p>
<p class="p1">I know those  are  horrible names too. Not a big fan of @Veto and @Requires.</p><p class="p1"><br></p><p class="p1">How about @ExcludeAsSource, and it has an optional attribute called requires that takes an array of class types?</p>
<p class="p1">I really really hate @Veto and @Requires. I guess I should search the mail list and see if I missed this conversation.</p><div><br></div>-- <br><b>Rick Hightower</b><br>(415) 968-9037 <br><a href="http://www.google.com/profiles/RichardHightower" target="_blank">Profile</a> <br>
<br>