Sounds ok. As far as I've understood the bval spec no reusable library must add any validation.xml because this file must only exists once for the whole app. There is no way of 'overloading' or preconfiguration for it as far as I'm aware.
LieGrue, strub ----- Original Message ----- > From: John D. Ament <john.d.am...@gmail.com> > To: dev@deltaspike.apache.org > Cc: > Sent: Monday, 10 June 2013, 1:17 > Subject: Re: DISCUSS DeltaSpike-332 > > Hi all > > So discussion on this died down after 2 days. I think there's kind of two > camps on this one. > > 1. Don't add because it's easy enough to DIY/no enough use cases/BVAL > 1.1 > is out. > 2. Do add because users can't upgrade to BeanVal 1.1/Easier to configure in > validation.xml > > So I'm going to go ahead and implement this as the following: > > 1. Create a new beanval module. > 2. Create a runtime only dependency that adds a class > "CDIAwareConstraintValidatorFactory" to the JAR. (e.g. there's no > API, > nothing to program against, only impl). > 3. Add instructions on how to configure in validation.xml > > Note that the configuration of validation.xml will be the optional > component, e.g. if you don't do this then the default implementation will > continue. > > John > > > On Sat, Jun 1, 2013 at 7:35 AM, John D. Ament > <john.d.am...@gmail.com>wrote: > >> Hi All >> >> I wanted to begin introducing some level of BeanValidation Support. The >> main goal that I have is to be able to create CDI aware constraint >> validators, let's say you want to validate @NonExistentEmail then you >> should be able to run a query against your DB using your CDI services and >> determine if the given email is already present or not. >> >> To do this, both Seam3 and CODI introduced a CDI aware ConstraintFactory. >> When it creates an instance the instance is a CDI object, so it has full >> access to @Inject fields. I'd like to bring this type of functionality >> over to DS. >> >> The point where the two diverge is that CODI does an auto registration >> whereas Seam3 does a registration via validation.xml. As far as I know, >> CDI already allows the injection of Validator and ValidatorFactory (though >> the OWB guys can tell me if they disagree). >> >> Please let me know if anyone has concerns with adding this. Yes, I >> realize that this functionality is in bean val 1.1, but not everyone can >> upgrade to bean val 1.1 yet. >> >> John >> >