onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject svn commit: r1444502 - in /incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation: ConfigurationStateProvider.java GuiceAwareConstraintValidatorFactory.java ValidatorFactoryProvider.java ValidatorProvider.java
Date Sun, 10 Feb 2013 08:18:32 GMT
Author: ash2k
Date: Sun Feb 10 08:18:32 2013
New Revision: 1444502

URL: http://svn.apache.org/r1444502
Log:
[ONAMI-79] Make validation-related objects immutable #resolve

Modified:
    incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ConfigurationStateProvider.java
    incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/GuiceAwareConstraintValidatorFactory.java
    incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorFactoryProvider.java
    incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorProvider.java

Modified: incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ConfigurationStateProvider.java
URL: http://svn.apache.org/viewvc/incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ConfigurationStateProvider.java?rev=1444502&r1=1444501&r2=1444502&view=diff
==============================================================================
--- incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ConfigurationStateProvider.java
(original)
+++ incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ConfigurationStateProvider.java
Sun Feb 10 08:18:32 2013
@@ -21,6 +21,7 @@ package org.apache.onami.validation;
 
 import javax.inject.Inject;
 import javax.inject.Provider;
+import javax.inject.Singleton;
 import javax.validation.ConstraintValidatorFactory;
 import javax.validation.MessageInterpolator;
 import javax.validation.TraversableResolver;
@@ -33,49 +34,33 @@ import org.apache.bval.jsr303.Configurat
 /**
  * The {@code javax.validation.spi.ConfigurationState} provider implementation.
  */
-public final class ConfigurationStateProvider
+@Singleton
+final class ConfigurationStateProvider
     implements Provider<ConfigurationState>
 {
 
     @com.google.inject.Inject( optional = true )
     private BootstrapState bootstrapState;
 
-    @Inject
-    private ValidationProvider<?> validationProvider;
-
-    @Inject
-    private TraversableResolver traversableResolver;
-
-    @Inject
-    private MessageInterpolator messageInterpolator;
+    private final ValidationProvider<?> validationProvider;
 
-    @Inject
-    private ConstraintValidatorFactory constraintValidatorFactory;
+    private final TraversableResolver traversableResolver;
 
-    public void setBootstrapState( BootstrapState bootstrapState )
-    {
-        this.bootstrapState = bootstrapState;
-    }
+    private final MessageInterpolator messageInterpolator;
 
-    public void setValidationProvider( ValidationProvider<?> validationProvider )
-    {
-        this.validationProvider = validationProvider;
-    }
+    private final ConstraintValidatorFactory constraintValidatorFactory;
 
-    public void setTraversableResolver( TraversableResolver traversableResolver )
-    {
-        this.traversableResolver = traversableResolver;
-    }
-
-    public void setMessageInterpolator( MessageInterpolator messageInterpolator )
-    {
-        this.messageInterpolator = messageInterpolator;
-    }
-
-    public void setConstraintValidatorFactory( ConstraintValidatorFactory constraintValidatorFactory
)
-    {
-        this.constraintValidatorFactory = constraintValidatorFactory;
-    }
+    @Inject
+    public ConfigurationStateProvider( ValidationProvider<?> validationProvider,
+			TraversableResolver traversableResolver,
+			MessageInterpolator messageInterpolator,
+			ConstraintValidatorFactory constraintValidatorFactory )
+    {
+		this.validationProvider = validationProvider;
+		this.traversableResolver = traversableResolver;
+		this.messageInterpolator = messageInterpolator;
+		this.constraintValidatorFactory = constraintValidatorFactory;
+	}
 
     /**
      * {@inheritDoc}

Modified: incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/GuiceAwareConstraintValidatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/GuiceAwareConstraintValidatorFactory.java?rev=1444502&r1=1444501&r2=1444502&view=diff
==============================================================================
--- incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/GuiceAwareConstraintValidatorFactory.java
(original)
+++ incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/GuiceAwareConstraintValidatorFactory.java
Sun Feb 10 08:18:32 2013
@@ -34,10 +34,10 @@ final class GuiceAwareConstraintValidato
     implements ConstraintValidatorFactory
 {
 
-    @Inject
-    private Injector injector;
+    private final Injector injector;
 
-    public void setInjector( Injector injector )
+    @Inject
+    public GuiceAwareConstraintValidatorFactory( Injector injector )
     {
         this.injector = injector;
     }

Modified: incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorFactoryProvider.java
URL: http://svn.apache.org/viewvc/incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorFactoryProvider.java?rev=1444502&r1=1444501&r2=1444502&view=diff
==============================================================================
--- incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorFactoryProvider.java
(original)
+++ incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorFactoryProvider.java
Sun Feb 10 08:18:32 2013
@@ -35,10 +35,10 @@ final class ValidatorFactoryProvider
     implements Provider<ValidatorFactory>
 {
 
-    @Inject
-    private ConfigurationState configurationState;
+    private final ConfigurationState configurationState;
 
-    public void setConfigurationState( ConfigurationState configurationState )
+    @Inject
+    public ValidatorFactoryProvider( ConfigurationState configurationState )
     {
         this.configurationState = configurationState;
     }

Modified: incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorProvider.java
URL: http://svn.apache.org/viewvc/incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorProvider.java?rev=1444502&r1=1444501&r2=1444502&view=diff
==============================================================================
--- incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorProvider.java
(original)
+++ incubator/onami/sandbox/validation/src/main/java/org/apache/onami/validation/ValidatorProvider.java
Sun Feb 10 08:18:32 2013
@@ -36,10 +36,10 @@ final class ValidatorProvider
     /**
      * The validator reference.
      */
-    @Inject
-    private ValidatorFactory validatorFactory;
+    private final ValidatorFactory validatorFactory;
 
-    public void setValidatorFactory( ValidatorFactory validatorFactory )
+    @Inject
+    public ValidatorProvider( ValidatorFactory validatorFactory )
     {
         this.validatorFactory = validatorFactory;
     }



Mime
View raw message