"Any class or package may be prevented from providing bean definitions based on the availability of other classes by adding the @Requires annotation on the class or package."

@Requires({Customer.class, Supplier.class}) public class Order { ...

}


Spring has something similar called @Required with some different behavior. But now that I think on it... it is different enough....

I'd prefer explicit names for these annotations. @ExcludeFromCDI and @ ExcludeFromCDIIfMissing.

I know those  are  horrible names too. Not a big fan of @Veto and @Requires.


How about @ExcludeAsSource, and it has an optional attribute called requires that takes an array of class types?

I really really hate @Veto and @Requires. I guess I should search the mail list and see if I missed this conversation.


--
Rick Hightower
(415) 968-9037
Profile