[cdi-dev] Vetoed with Expression
Otávio Gonçalves de Santana
otaviojava at java.net
Fri Feb 20 16:23:07 EST 2015
In CDI we have the Vetoed annotation[1] that vetoes the class, but we can't
use expression to represent exclude this class. This feature would useful
to many things, for example, an internationalization of payment[2] or just
have a class that should not run when is in production. In Delta Spike[3],
already there are this improvement.
[1]http://docs.jboss.org/cdi/api/1.2/javax/enterprise/inject/Vetoed.html
[2]
public interface Payment {
void pay();
}
@Vetoed(onExpression = "instance eq brazil", interpretedBy =
PaymentInterpreter.class)
class BrazilianPayment implements Payment {
...
}
@Vetoed(onExpression = "instance eq mexico", interpretedBy =
PaymentInterpreter.class)
class MexicanPayment implements Payment {
...
}
[3]https://deltaspike.apache.org/documentation/core.html#__exclude
--
Otávio Gonçalves de Santana
twitter: http://twitter.com/otaviojava
site: *http://about.me/otaviojava <http://about.me/otaviojava>*
55 (11) 98255-3513
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150220/0b853211/attachment-0001.html
More information about the cdi-dev
mailing list