Return-Path: X-Original-To: apmail-deltaspike-commits-archive@www.apache.org Delivered-To: apmail-deltaspike-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 524C5175C9 for ; Mon, 6 Oct 2014 21:33:50 +0000 (UTC) Received: (qmail 25843 invoked by uid 500); 6 Oct 2014 21:33:50 -0000 Delivered-To: apmail-deltaspike-commits-archive@deltaspike.apache.org Received: (qmail 25810 invoked by uid 500); 6 Oct 2014 21:33:50 -0000 Mailing-List: contact commits-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltaspike.apache.org Delivered-To: mailing list commits@deltaspike.apache.org Received: (qmail 25801 invoked by uid 99); 6 Oct 2014 21:33:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2014 21:33:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7B6628B3956; Mon, 6 Oct 2014 21:33:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rafabene@apache.org To: commits@deltaspike.apache.org Message-Id: <94d7b591892a4ec5a1b7a599bb0be9e3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [DELTASPIKE-DOC] - Fix bean-validation doc sources formating Date: Mon, 6 Oct 2014 21:33:49 +0000 (UTC) Repository: deltaspike Updated Branches: refs/heads/master e836d91a4 -> 13330996c [DELTASPIKE-DOC] - Fix bean-validation doc sources formating Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/13330996 Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/13330996 Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/13330996 Branch: refs/heads/master Commit: 13330996cd7fb8700bdb35cd591e386b194bba54 Parents: e836d91 Author: Rafael Benevides Authored: Mon Oct 6 18:33:01 2014 -0300 Committer: Rafael Benevides Committed: Mon Oct 6 18:33:01 2014 -0300 ---------------------------------------------------------------------- .../src/main/asciidoc/bean-validation.adoc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/deltaspike/blob/13330996/documentation/src/main/asciidoc/bean-validation.adoc ---------------------------------------------------------------------- diff --git a/documentation/src/main/asciidoc/bean-validation.adoc b/documentation/src/main/asciidoc/bean-validation.adoc index 0210948..e756824 100644 --- a/documentation/src/main/asciidoc/bean-validation.adoc +++ b/documentation/src/main/asciidoc/bean-validation.adoc @@ -7,40 +7,37 @@ == Introduction The main feature of the Bean Validation module is to provide CDI -integration in to `ConstraintValidator`s. This allows you to inject 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. +`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: [source,java] ------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------- Validation.byDefaultProvider().configure().constraintValidatorFactory(new CDIAwareConstraintValidatorFactory()).buildValidatorFactory() -------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------- Or in XML: [source,xml] ------------------------------------------------------------------------------------------------------------------------- -:::xml +-------------------------------------------------------------------------------- org.apache.deltaspike.beanvalidation.impl.CDIAwareConstraintValidatorFactory ------------------------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- And then you can simply build your `ConstraintValidator`s based on CDI programming rules.