incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r925693 - in /incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice: ValidateMethodInterceptor.java ValidationModule.java
Date Sat, 20 Mar 2010 22:01:48 GMT
Author: simonetripodi
Date: Sat Mar 20 22:01:47 2010
New Revision: 925693

URL: http://svn.apache.org/viewvc?rev=925693&view=rev
Log:
plugged the validation interceptor in the validation module

Modified:
    incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidateMethodInterceptor.java
    incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidationModule.java

Modified: incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidateMethodInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidateMethodInterceptor.java?rev=925693&r1=925692&r2=925693&view=diff
==============================================================================
--- incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidateMethodInterceptor.java
(original)
+++ incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidateMethodInterceptor.java
Sat Mar 20 22:01:47 2010
@@ -36,15 +36,15 @@ public final class ValidateMethodInterce
     /**
      * The Validator reference.
      */
-    private final Validator validator;
+    @Inject
+    private Validator validator;
 
     /**
-     * Creates a new Valitation Inerceptor given a Validator reference.
+     * Sets the Validator reference.
      *
-     * @param validator
+     * @param validator the Validator reference.
      */
-    @Inject
-    public ValidateMethodInterceptor(Validator validator) {
+    public void setValidator(Validator validator) {
         this.validator = validator;
     }
 

Modified: incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidationModule.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidationModule.java?rev=925693&r1=925692&r2=925693&view=diff
==============================================================================
--- incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidationModule.java
(original)
+++ incubator/bval/sandbox/guice-integration/src/main/java/org/apache/bval/extentions/guice/ValidationModule.java
Sat Mar 20 22:01:47 2010
@@ -26,6 +26,7 @@ import javax.validation.ValidatorFactory
 import com.google.inject.AbstractModule;
 import com.google.inject.Provider;
 import com.google.inject.TypeLiteral;
+import com.google.inject.matcher.Matchers;
 
 /**
  * The Google-Guice module for Apache Bean Validation.
@@ -116,6 +117,8 @@ public final class ValidationModule exte
 
         this.bind(ValidatorFactory.class).toProvider(ValidatorFactoryProvider.class).asEagerSingleton();
         this.bind(Validator.class).toProvider(ValidatorProvider.class).asEagerSingleton();
+
+        this.bindInterceptor(Matchers.any(), Matchers.annotatedWith(Validate.class), new
ValidateMethodInterceptor());
     }
 
 }



Mime
View raw message