[bv-dev] BVAL-221 Constraint violation builder cannot put constraint on a top level map key

Hardy Ferentschik hardy at hibernate.org
Mon Nov 26 07:07:08 EST 2012


On 23 Jan 2012, at 2:48 PM, Emmanuel Bernard <emmanuel at hibernate.org> wrote:

> The question is do we want to do that or lean towards one of the
> alternative methods:
> 
> - an explicit new method deprecating addNode
> - relaxing NodeBuilderDefinedContext and adding the new contract on it

In the proposal you are saying about relaxing NodeBuilderDefinedContext:  "But that would break the contextual 
and safety of the API as this interface is also returned by atKey and atIndex." 
Can you provide an example?

Also in the proposal you are saying that:

context.buildConstraintViolationWithTemplate("oh noes")
        .addNode(null) //ie the contained element
            inIterable().atKey(someKey)
        .addConstraintViolation();

would be the natural solution. Why is ".addNode(null)" natural and why could we not have inIterable() directly 
on ConstraintViolationBuilder?

--Hardy




More information about the beanvalidation-dev mailing list