myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r930776 - in /myfaces/extensions/cdi/trunk: core/ core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/ jee-modules/bv-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/bv/impl/ jee-modules/jsf-module/...
Date Mon, 05 Apr 2010 01:23:19 GMT
Author: gpetracek
Date: Mon Apr  5 01:23:18 2010
New Revision: 930776

URL: http://svn.apache.org/viewvc?rev=930776&view=rev
Log:
EXTCDI-8 indirection to get rid of dependencies in the core

Added:
    myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/BeanValidation.java
      - copied, changed from r930769, myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/Advanced.java
    myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/GenericResolver.java
      - copied, changed from r930765, myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/ValidatorFactoryResolver.java
Removed:
    myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/ValidatorFactoryResolver.java
Modified:
    myfaces/extensions/cdi/trunk/core/pom.xml
    myfaces/extensions/cdi/trunk/jee-modules/bv-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/bv/impl/CdiAwareBeanValidationProducer.java
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/resolver/JsfValidatorFactoryResolver.java
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/pom.xml

Copied: myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/BeanValidation.java
(from r930769, myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/Advanced.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/BeanValidation.java?p2=myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/BeanValidation.java&p1=myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/Advanced.java&r1=930769&r2=930776&rev=930776&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/Advanced.java
(original)
+++ myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/BeanValidation.java
Mon Apr  5 01:23:18 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.myfaces.extensions.cdi.core.api;
+package org.apache.myfaces.extensions.cdi.core.api.resolver;
 
 import javax.inject.Qualifier;
 import java.lang.annotation.Target;
@@ -27,15 +27,21 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.ElementType.METHOD;
 import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.ElementType.TYPE;
 
 /**
  * @author Gerhard Petracek
  */
-@Target({PARAMETER, FIELD, METHOD, CONSTRUCTOR})
+@Target({PARAMETER, FIELD, METHOD, CONSTRUCTOR, TYPE})
 @Retention(RUNTIME)
 @Documented
 
 @Qualifier
-public @interface Advanced
+public @interface BeanValidation
 {
-}
+    public enum ArtifactType {
+        ValidatorFactory, Validator, ConstraintValidatorFactory, MessageInterpolator, TraversableResolver
+    }
+
+    ArtifactType value() default ArtifactType.ValidatorFactory;
+}
\ No newline at end of file

Copied: myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/GenericResolver.java
(from r930765, myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/ValidatorFactoryResolver.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/GenericResolver.java?p2=myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/GenericResolver.java&p1=myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/ValidatorFactoryResolver.java&r1=930765&r2=930776&rev=930776&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/ValidatorFactoryResolver.java
(original)
+++ myfaces/extensions/cdi/trunk/core/api/src/main/java/org/apache/myfaces/extensions/cdi/core/api/resolver/GenericResolver.java
Mon Apr  5 01:23:18 2010
@@ -18,12 +18,10 @@
  */
 package org.apache.myfaces.extensions.cdi.core.api.resolver;
 
-import javax.validation.ValidatorFactory;
-
 /**
  * @author Gerhard Petracek
  */
-public interface ValidatorFactoryResolver
+public interface GenericResolver<T>
 {
-    ValidatorFactory getValidatorFactory();
+    T resolve();
 }

Modified: myfaces/extensions/cdi/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/core/pom.xml?rev=930776&r1=930775&r2=930776&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/core/pom.xml (original)
+++ myfaces/extensions/cdi/trunk/core/pom.xml Mon Apr  5 01:23:18 2010
@@ -56,10 +56,6 @@
     </repositories>
 
     <dependencies>
-        <dependency>
-            <groupId>javax.validation</groupId>
-            <artifactId>validation-api</artifactId>
-        </dependency>
     </dependencies>
 
 </project>

Modified: myfaces/extensions/cdi/trunk/jee-modules/bv-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/bv/impl/CdiAwareBeanValidationProducer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/bv-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/bv/impl/CdiAwareBeanValidationProducer.java?rev=930776&r1=930775&r2=930776&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/bv-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/bv/impl/CdiAwareBeanValidationProducer.java
(original)
+++ myfaces/extensions/cdi/trunk/jee-modules/bv-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/bv/impl/CdiAwareBeanValidationProducer.java
Mon Apr  5 01:23:18 2010
@@ -19,7 +19,8 @@
 package org.apache.myfaces.extensions.cdi.javaee.bv.impl;
 
 import org.apache.myfaces.extensions.cdi.core.api.Advanced;
-import org.apache.myfaces.extensions.cdi.core.api.resolver.ValidatorFactoryResolver;
+import org.apache.myfaces.extensions.cdi.core.api.resolver.BeanValidation;
+import org.apache.myfaces.extensions.cdi.core.api.resolver.GenericResolver;
 
 import javax.enterprise.context.Dependent;
 import javax.enterprise.inject.Produces;
@@ -44,9 +45,9 @@ public class CdiAwareBeanValidationProdu
     @Dependent
     @Advanced
     public ValidatorFactory createValidatorFactoryForDependencyInjectionAwareConstraintValidators(
-            ValidatorFactoryResolver validatorFactoryResolver)
+            @BeanValidation GenericResolver<ValidatorFactory> validatorFactoryResolver)
     {
-        ValidatorFactory validatorFactory = validatorFactoryResolver.getValidatorFactory();
+        ValidatorFactory validatorFactory = validatorFactoryResolver.resolve();
         if (validatorFactory == null)
         {
             if (defaultValidatorFactory == null)
@@ -63,7 +64,7 @@ public class CdiAwareBeanValidationProdu
     @Dependent
     @Advanced
     public Validator createValidatorForDependencyInjectionAwareConstraintValidators(
-            ValidatorFactoryResolver validatorFactoryResolver)
+            @BeanValidation GenericResolver<ValidatorFactory> validatorFactoryResolver)
     {
         return createValidatorFactoryForDependencyInjectionAwareConstraintValidators(
                 validatorFactoryResolver).getValidator();
@@ -73,7 +74,7 @@ public class CdiAwareBeanValidationProdu
     @Dependent
     @Advanced
     public ConstraintValidatorFactory createConstraintValidatorFactoryForDependencyInjectionAwareConstraintValidators(
-            ValidatorFactoryResolver validatorFactoryResolver)
+            @BeanValidation GenericResolver<ValidatorFactory> validatorFactoryResolver)
     {
         return createValidatorFactoryForDependencyInjectionAwareConstraintValidators(
                 validatorFactoryResolver).getConstraintValidatorFactory();
@@ -83,7 +84,7 @@ public class CdiAwareBeanValidationProdu
     @Dependent
     @Advanced
     public MessageInterpolator createMessageInterpolator(
-            ValidatorFactoryResolver validatorFactoryResolver)
+            @BeanValidation GenericResolver<ValidatorFactory> validatorFactoryResolver)
     {
         return createValidatorFactoryForDependencyInjectionAwareConstraintValidators(
                 validatorFactoryResolver).getMessageInterpolator();

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/resolver/JsfValidatorFactoryResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/resolver/JsfValidatorFactoryResolver.java?rev=930776&r1=930775&r2=930776&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/resolver/JsfValidatorFactoryResolver.java
(original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/resolver/JsfValidatorFactoryResolver.java
Mon Apr  5 01:23:18 2010
@@ -18,7 +18,8 @@
  */
 package org.apache.myfaces.extensions.cdi.javaee.jsf.impl.resolver;
 
-import org.apache.myfaces.extensions.cdi.core.api.resolver.ValidatorFactoryResolver;
+import org.apache.myfaces.extensions.cdi.core.api.resolver.GenericResolver;
+import org.apache.myfaces.extensions.cdi.core.api.resolver.BeanValidation;
 
 import javax.faces.context.FacesContext;
 import javax.validation.Validation;
@@ -28,11 +29,12 @@ import java.util.Map;
 /**
  * @author Gerhard Petracek
  */
-public class JsfValidatorFactoryResolver implements ValidatorFactoryResolver
+@BeanValidation
+public class JsfValidatorFactoryResolver implements GenericResolver<ValidatorFactory>
 {
     private static final String VALIDATOR_FACTORY_KEY = "javax.faces.validator.beanValidator.ValidatorFactory";
 
-    public ValidatorFactory getValidatorFactory()
+    public ValidatorFactory resolve()
     {
         Map<String, Object> applicationMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
         ValidatorFactory validatorFactory = null;

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/pom.xml?rev=930776&r1=930775&r2=930776&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/pom.xml (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/pom.xml Mon Apr  5 01:23:18 2010
@@ -48,6 +48,11 @@
             <version>${jsf.version}</version>
             <scope>compile</scope>
         </dependency>
+
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+        </dependency>
     </dependencies>
 
     <properties>



Mime
View raw message