Title: Bean Validation Module Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. [TOC] *** # Introduction The main feature of the Bean Validation module is to provide CDI integration in to `ConstraintValidator`s. This allows you to inject CDI objects, EJBs etc in to your validators. ## Scoping `ConstraintValidator`s will inherit whatever scope as defined in the bean class. Inherently, a `ConstraintValidator` may be invoked by multiple threads so please keep that in mind when using them. You should consider using at least `RequestScoped` validators. ## Code Requirements There are no compile dependencies to use the Bean Validation module. You simply need to override the factory, either in Java: :::java Validation.byDefaultProvider().configure().constraintValidatorFactory(new CDIAwareConstraintValidatorFactory()).buildValidatorFactory() Or in XML: :::xml org.apache.deltaspike.beanvalidation.impl.CDIAwareConstraintValidatorFactory And then you can simply build your `ConstraintValidator`s based on CDI programming rules.