myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r827738 - in /myfaces/extensions/validator/branches/branch_for_jsf_1_1: core/src/main/java/org/apache/myfaces/extensions/validator/util/ validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metada...
Date Tue, 20 Oct 2009 17:41:35 GMT
Author: gpetracek
Date: Tue Oct 20 17:41:35 2009
New Revision: 827738

URL: http://svn.apache.org/viewvc?rev=827738&view=rev
Log:
addition for EXTVAL-68

Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/NotNullMetaDataTransformer.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java?rev=827738&r1=827737&r2=827738&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
Tue Oct 20 17:41:35 2009
@@ -637,13 +637,13 @@
         return !"false".equalsIgnoreCase(WebXmlParameter.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL);
     }
 
-    public static PropertyDetails getPropertyDetails(PropertyInformation propertyInformation)
+    public static boolean validateEmptyFields()
     {
-        return propertyInformation.getInformation(PropertyInformationKeys.PROPERTY_DETAILS,
PropertyDetails.class);
+        return !"false".equalsIgnoreCase(WebXmlParameter.VALIDATE_EMPTY_FIELDS);
     }
 
-    public static boolean validateEmptyFields()
+    public static PropertyDetails getPropertyDetails(PropertyInformation propertyInformation)
     {
-        return !"false".equalsIgnoreCase(WebXmlParameter.VALIDATE_EMPTY_FIELDS);
+        return propertyInformation.getInformation(PropertyInformationKeys.PROPERTY_DETAILS,
PropertyDetails.class);
     }
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/NotNullMetaDataTransformer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/NotNullMetaDataTransformer.java?rev=827738&r1=827737&r2=827738&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/NotNullMetaDataTransformer.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/metadata/transformer/NotNullMetaDataTransformer.java
Tue Oct 20 17:41:35 2009
@@ -19,6 +19,7 @@
 package org.apache.myfaces.extensions.validator.beanval.metadata.transformer;
 
 import org.apache.myfaces.extensions.validator.core.metadata.CommonMetaDataKeys;
+import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 
 import javax.validation.constraints.NotNull;
 import javax.validation.metadata.ConstraintDescriptor;
@@ -34,7 +35,11 @@
     protected Map<String, Object> convertConstraintDescriptor(ConstraintDescriptor<NotNull>
constraintDescriptor)
     {
         Map<String, Object> results = new HashMap<String, Object>();
-        results.put(CommonMetaDataKeys.WEAK_REQUIRED, true);
+
+        if(ExtValUtils.interpretEmptyStringValuesAsNull())
+        {
+            results.put(CommonMetaDataKeys.WEAK_REQUIRED, true);
+        }
         return results;
     }
-}
+}
\ No newline at end of file



Mime
View raw message