myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r885908 - in /myfaces/extensions/validator/trunk: core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/ test-modules/property-validation-test...
Date Tue, 01 Dec 2009 20:25:28 GMT
Author: gpetracek
Date: Tue Dec  1 20:25:28 2009
New Revision: 885908

URL: http://svn.apache.org/viewvc?rev=885908&view=rev
Log:
EXTVAL-74 implementation and test-cases

Added:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/EmptyValueAwareValidationStrategy.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/NullAwareValidationStrategy.java
Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/baseval/BaseValTestCase.java
    myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/StringSizeMetaDataTransformer.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/metadata/transformer/LengthMetaDataTransformer.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/JpaValidationStrategy.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/RequiredStrategy.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/SkipValidationStrategy.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
Tue Dec  1 20:25:28 2009
@@ -22,6 +22,8 @@
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy;
 import org.apache.myfaces.extensions.validator.core.validation.SkipValidationEvaluator;
+import org.apache.myfaces.extensions.validator.core.validation.NullAwareValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 import org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor;
 import org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry;
 import org.apache.myfaces.extensions.validator.core.property.PropertyInformation;
@@ -125,7 +127,8 @@
         {
             validationStrategy = ExtValUtils.getValidationStrategyForMetaData(entry.getKey());
 
-            if (validationStrategy != null)
+            if (validationStrategy != null &&
+                    isValidationStrategyCompatibleWithValue(validationStrategy,  convertedObject))
             {
                 if(skipValidationEvaluator.skipValidation(facesContext, uiComponent, validationStrategy,
entry))
                 {
@@ -172,16 +175,24 @@
                     }
                 }
             }
-            else
+            else if(validationStrategy == null && logger.isTraceEnabled())
             {
-                if(logger.isTraceEnabled())
-                {
-                    logger.trace("no validation strategy found for " + entry.getValue());
-                }
+                logger.trace("no validation strategy found for " + entry.getValue());
             }
         }
     }
 
+    protected boolean isValidationStrategyCompatibleWithValue(ValidationStrategy validationStrategy,
Object value)
+    {
+        if(value == null)
+        {
+            return validationStrategy.getClass().isAnnotationPresent(NullAwareValidationStrategy.class);
+        }
+
+        return !"".equals(value) || validationStrategy.getClass()
+                .isAnnotationPresent(EmptyValueAwareValidationStrategy.class);
+    }
+
     @Override
     /**
      * to ensure backward compatibility

Added: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/EmptyValueAwareValidationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/EmptyValueAwareValidationStrategy.java?rev=885908&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/EmptyValueAwareValidationStrategy.java
(added)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/EmptyValueAwareValidationStrategy.java
Tue Dec  1 20:25:28 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.validator.core.validation;
+
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * @author Gerhard Petracek
+ * @since x.x.3
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+@Documented
+@UsageInformation(UsageCategory.API)
+public @interface EmptyValueAwareValidationStrategy
+{
+}
\ No newline at end of file

Added: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/NullAwareValidationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/NullAwareValidationStrategy.java?rev=885908&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/NullAwareValidationStrategy.java
(added)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/NullAwareValidationStrategy.java
Tue Dec  1 20:25:28 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.validator.core.validation;
+
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * @author Gerhard Petracek
+ * @since x.x.3
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+@Documented
+@UsageInformation(UsageCategory.API)
+public @interface NullAwareValidationStrategy
+{
+}
\ No newline at end of file

Modified: myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/baseval/BaseValTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/baseval/BaseValTestCase.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/baseval/BaseValTestCase.java
(original)
+++ myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/baseval/BaseValTestCase.java
Tue Dec  1 20:25:28 2009
@@ -134,6 +134,20 @@
         checkMessageCount(1);
     }
 
+    public void testName1NoLenght() throws Exception
+    {
+        createValueBinding(inputComponent, "value", "#{testBean.name1}");
+
+        //decode
+        inputComponent.setSubmittedValue("");
+
+        //validate
+        inputComponent.validate(facesContext);
+
+        assertTrue(inputComponent.isValid());
+        checkMessageCount(0);
+    }
+
     public void testPatternNameFail() throws Exception
     {
         createValueBinding(inputComponent, "value", "#{testBean.patternName}");
@@ -148,6 +162,20 @@
         checkMessageCount(1);
     }
 
+    public void testPatternNoName() throws Exception
+    {
+        createValueBinding(inputComponent, "value", "#{testBean.patternName}");
+
+        //decode
+        inputComponent.setSubmittedValue("");
+
+        //validate
+        inputComponent.validate(facesContext);
+
+        assertTrue(inputComponent.isValid());
+        checkMessageCount(0);
+    }
+
     public void testPatternNameCorrect() throws Exception
     {
         createValueBinding(inputComponent, "value", "#{testBean.patternName}");
@@ -193,4 +221,18 @@
         inputComponent.updateModel(facesContext);
         assertEquals(200d, bean.getDoubleValue1());
     }
+
+    public void testDoubleNoValue() throws Exception
+    {
+        createValueBinding(inputComponent, "value", "#{testBean.doubleValue1}");
+
+        //decode
+        inputComponent.setSubmittedValue("");
+
+        //validate
+        inputComponent.validate(facesContext);
+
+        assertTrue(inputComponent.isValid());
+        checkMessageCount(0);
+    }
 }
\ No newline at end of file

Modified: myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/StringSizeMetaDataTransformer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/StringSizeMetaDataTransformer.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/StringSizeMetaDataTransformer.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/StringSizeMetaDataTransformer.java
Tue Dec  1 20:25:28 2009
@@ -41,7 +41,6 @@
         if(minimum != 0)
         {
             results.put(CommonMetaDataKeys.MIN_LENGTH, minimum);
-            results.put(CommonMetaDataKeys.WEAK_REQUIRED, true);
         }
         else
         {

Modified: myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/metadata/transformer/LengthMetaDataTransformer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/metadata/transformer/LengthMetaDataTransformer.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/metadata/transformer/LengthMetaDataTransformer.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/metadata/transformer/LengthMetaDataTransformer.java
Tue Dec  1 20:25:28 2009
@@ -44,7 +44,6 @@
         if(minimum != 0)
         {
             results.put(CommonMetaDataKeys.MIN_LENGTH, minimum);
-            results.put(CommonMetaDataKeys.WEAK_REQUIRED, true);
         }
         else
         {

Modified: myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/JpaValidationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/JpaValidationStrategy.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/JpaValidationStrategy.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/JpaValidationStrategy.java
Tue Dec  1 20:25:28 2009
@@ -23,6 +23,8 @@
 import org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy;
 import org.apache.myfaces.extensions.validator.core.validation.message.resolver.AbstractValidationErrorMessageResolver;
 import org.apache.myfaces.extensions.validator.core.validation.exception.RequiredValidatorException;
+import org.apache.myfaces.extensions.validator.core.validation.NullAwareValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 import org.apache.myfaces.extensions.validator.internal.Priority;
 import org.apache.myfaces.extensions.validator.internal.ToDo;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
@@ -44,6 +46,8 @@
  * @author Gerhard Petracek
  * @since 1.x.1
  */
+@NullAwareValidationStrategy
+@EmptyValueAwareValidationStrategy
 @UsageInformation(UsageCategory.INTERNAL)
 public class JpaValidationStrategy extends AbstractAnnotationValidationStrategy
 {

Modified: myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/RequiredStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/RequiredStrategy.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/RequiredStrategy.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/RequiredStrategy.java
Tue Dec  1 20:25:28 2009
@@ -24,6 +24,8 @@
 import org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy;
 import org.apache.myfaces.extensions.validator.core.validation.message.resolver.AbstractValidationErrorMessageResolver;
 import org.apache.myfaces.extensions.validator.core.validation.exception.RequiredValidatorException;
+import org.apache.myfaces.extensions.validator.core.validation.NullAwareValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
@@ -39,6 +41,8 @@
  * @since 1.x.1
  */
 @SkipValidationSupport
+@NullAwareValidationStrategy
+@EmptyValueAwareValidationStrategy
 @UsageInformation(UsageCategory.INTERNAL)
 public class RequiredStrategy extends AbstractAnnotationValidationStrategy<Required>
 {

Modified: myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/SkipValidationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/SkipValidationStrategy.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/SkipValidationStrategy.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/SkipValidationStrategy.java
Tue Dec  1 20:25:28 2009
@@ -22,6 +22,8 @@
 import org.apache.myfaces.extensions.validator.core.property.PropertyInformationKeys;
 import org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry;
 import org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.NullAwareValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 import org.apache.myfaces.extensions.validator.core.el.ValueBindingExpression;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
@@ -35,6 +37,8 @@
  * @author Gerhard Petracek
  * @since 1.x.1
  */
+@NullAwareValidationStrategy
+@EmptyValueAwareValidationStrategy
 @UsageInformation(UsageCategory.INTERNAL)
 public class SkipValidationStrategy implements ValidationStrategy
 {

Modified: myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
Tue Dec  1 20:25:28 2009
@@ -23,6 +23,8 @@
 import org.apache.myfaces.extensions.validator.baseval.annotation.SkipValidationSupport;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+import org.apache.myfaces.extensions.validator.core.validation.NullAwareValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 
 import java.lang.annotation.Annotation;
 
@@ -31,6 +33,8 @@
  * @since 1.x.1
  */
 @SkipValidationSupport
+@NullAwareValidationStrategy
+@EmptyValueAwareValidationStrategy
 @UsageInformation(UsageCategory.INTERNAL)
 public class EqualsStrategy extends AbstractCompareStrategy
 {

Modified: myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
Tue Dec  1 20:25:28 2009
@@ -22,6 +22,8 @@
 import org.apache.myfaces.extensions.validator.baseval.annotation.SkipValidationSupport;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+import org.apache.myfaces.extensions.validator.core.validation.NullAwareValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 
 import java.lang.annotation.Annotation;
 
@@ -30,6 +32,8 @@
  * @since 1.x.1
  */
 @SkipValidationSupport
+@NullAwareValidationStrategy
+@EmptyValueAwareValidationStrategy
 @UsageInformation(UsageCategory.INTERNAL)
 public class NotEqualsStrategy extends EqualsStrategy
 {

Modified: myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java?rev=885908&r1=885907&r2=885908&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java
Tue Dec  1 20:25:28 2009
@@ -25,6 +25,8 @@
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.myfaces.extensions.validator.core.validation.message.resolver.AbstractValidationErrorMessageResolver;
+import org.apache.myfaces.extensions.validator.core.validation.NullAwareValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 
 import javax.faces.validator.ValidatorException;
@@ -34,6 +36,8 @@
  * @since 1.x.1
  */
 @SkipValidationSupport
+@NullAwareValidationStrategy
+@EmptyValueAwareValidationStrategy
 @UsageInformation(UsageCategory.INTERNAL)
 public class RequiredIfStrategy extends AbstractCompareStrategy<RequiredIf>
 {



Mime
View raw message