[bv-dev] Group conversion on overridden method

Gunnar Morling gunnar at hibernate.org
Mon Jan 28 11:51:25 EST 2013


Emmanuel, all,

I need a short confirmation related to the definition of group conversions
for the return value of an overriding method. IIUC, the following is legal:

Class Foo {
    public Bar getBar() {}
}

Class SubFoo extends Foo {

    @Valid
    @ConvertGroup(from=..., to=...)
    @Override
    public Bar getBar() {}
}

That is, SubFoo can define a group conversion for the return value as
@Valid itself is added in SubFoo only. It would be illegal if @Valid was
given in Foo, too.

I think that makes sense since LSP is not violated by the first variant,
while it would in the second (a user of Foo wouldn't be aware of the
applying conversions).

Right?

Thanks,

--Gunnar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20130128/4a27f44e/attachment.html 


More information about the beanvalidation-dev mailing list