[bv-dev] XML-based configuration of method constraints and group conversions

Gunnar Morling gunnar at hibernate.org
Fri Jan 18 10:28:12 EST 2013


2013/1/18 Emmanuel Bernard <emmanuel at hibernate.org>

> Do you think it makes sense to force people to always use getter for
> getters? My only concern is that it might feel awkward for what I call
> action getters that people don't consider getters.
>

Hum, I don't think it makes sense to enforce this. The idea is that you can
chose to use either "getter":

    <getter name="foo">
        <valid/>
        <constraint annotation="javax.validation.constraints.NotNull"/>
    </getter>

or "method" (e.g. for an "action getter"):

    <method name="getFoo">
        <return-value>
            <valid/>
            <constraint annotation="javax.validation.constraints.NotNull"/>
        </return-value>
    </method>

as you like, but not both at the same time as they could conflict (similar
to that you must not have two "getter" elements with the same name).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20130118/974df910/attachment.html 


More information about the beanvalidation-dev mailing list