onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1443337 - /incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidationModule.java
Date Thu, 07 Feb 2013 07:51:26 GMT
Author: simonetripodi
Date: Thu Feb  7 07:51:26 2013
New Revision: 1443337

URL: http://svn.apache.org/viewvc?rev=1443337&view=rev
Log:
@trivial statically imported SINGLETON Scope to have more functional-ish bindings

Modified:
    incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidationModule.java

Modified: incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidationModule.java
URL: http://svn.apache.org/viewvc/incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidationModule.java?rev=1443337&r1=1443336&r2=1443337&view=diff
==============================================================================
--- incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidationModule.java
(original)
+++ incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidationModule.java
Thu Feb  7 07:51:26 2013
@@ -19,6 +19,7 @@ package org.apache.onami.validation;
  * under the License.
  */
 
+import static com.google.inject.Scopes.SINGLETON;
 import static com.google.inject.matcher.Matchers.annotatedWith;
 import static com.google.inject.matcher.Matchers.any;
 
@@ -38,7 +39,6 @@ import org.kohsuke.MetaInfServices;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Module;
-import com.google.inject.Scopes;
 import com.google.inject.TypeLiteral;
 
 /**
@@ -56,12 +56,12 @@ public final class ValidationModule
     protected void configure()
     {
         // apache bval bootstrap
-        bind( MessageInterpolator.class ).to( DefaultMessageInterpolator.class ).in( Scopes.SINGLETON
);
-        bind( TraversableResolver.class ).to( DefaultTraversableResolver.class ).in( Scopes.SINGLETON
);
+        bind( MessageInterpolator.class ).to( DefaultMessageInterpolator.class ).in( SINGLETON
);
+        bind( TraversableResolver.class ).to( DefaultTraversableResolver.class ).in( SINGLETON
);
         bind( ConstraintValidatorFactory.class ).to( GuiceAwareConstraintValidatorFactory.class
);
-        bind( new TypeLiteral<ValidationProvider<?>>(){} ).to( ApacheValidationProvider.class
).in( Scopes.SINGLETON );
-        bind( ConfigurationState.class ).toProvider( ConfigurationStateProvider.class ).in(
Scopes.SINGLETON );
-        bind( ValidatorFactory.class ).toProvider( ValidatorFactoryProvider.class ).in( Scopes.SINGLETON
);
+        bind( new TypeLiteral<ValidationProvider<?>>(){} ).to( ApacheValidationProvider.class
).in( SINGLETON );
+        bind( ConfigurationState.class ).toProvider( ConfigurationStateProvider.class ).in(
SINGLETON );
+        bind( ValidatorFactory.class ).toProvider( ValidatorFactoryProvider.class ).in( SINGLETON
);
         bind( Validator.class ).toProvider( ValidatorProvider.class );
 
         // AOP stuff



Mime
View raw message