myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r831628 - in /myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval: storage/ util/ validation/
Date Sun, 01 Nov 2009 00:57:10 GMT
Author: gpetracek
Date: Sun Nov  1 00:57:10 2009
New Revision: 831628

URL: http://svn.apache.org/viewvc?rev=831628&view=rev
Log:
small refactorings

Modified:
    myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/ModelValidationEntry.java
    myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/util/BeanValidationUtils.java
    myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/validation/ModelValidationPhaseListener.java

Modified: myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/ModelValidationEntry.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/ModelValidationEntry.java?rev=831628&r1=831627&r2=831628&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/ModelValidationEntry.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/storage/ModelValidationEntry.java
Sun Nov  1 00:57:10 2009
@@ -38,8 +38,8 @@
     private List<Class> groups = new ArrayList<Class>();
     private List<Object> validationTargets = new ArrayList<Object>();
     private List<String> validationTargetExpressions = new ArrayList<String>();
-    private boolean displayInline = false;
-    private String message = ModelValidation.DEFAULT_MESSAGE;
+    private boolean displayMessageInline = false;
+    private String customMessage = ModelValidation.DEFAULT_MESSAGE;
     private Object metaDataSourceObject;
     private String viewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();
 
@@ -178,24 +178,24 @@
         return true;
     }
 
-    public boolean isDisplayInline()
+    public boolean isDisplayMessageInline()
     {
-        return displayInline;
+        return displayMessageInline;
     }
 
-    public void setDisplayInline(boolean displayInline)
+    public void setDisplayMessageInline(boolean displayMessageInline)
     {
-        this.displayInline = displayInline;
+        this.displayMessageInline = displayMessageInline;
     }
 
-    public String getMessage()
+    public String getCustomMessage()
     {
-        return message;
+        return customMessage;
     }
 
-    public void setMessage(String message)
+    public void setCustomMessage(String customMessage)
     {
-        this.message = message;
+        this.customMessage = customMessage;
     }
 
     @Override

Modified: myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/util/BeanValidationUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/util/BeanValidationUtils.java?rev=831628&r1=831627&r2=831628&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/util/BeanValidationUtils.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/util/BeanValidationUtils.java
Sun Nov  1 00:57:10 2009
@@ -404,8 +404,8 @@
         ModelValidationEntry modelValidationEntry = new ModelValidationEntry();
 
         modelValidationEntry.setGroups(Arrays.asList(beanValidation.useGroups()));
-        modelValidationEntry.setDisplayInline(beanValidation.modelValidation().displayInline());
-        modelValidationEntry.setMessage(beanValidation.modelValidation().message());
+        modelValidationEntry.setDisplayMessageInline(beanValidation.modelValidation().displayInline());
+        modelValidationEntry.setCustomMessage(beanValidation.modelValidation().message());
         modelValidationEntry.setMetaDataSourceObject(metaDataSourceObject);
 
         for(String validationTargetExpression : beanValidation.modelValidation().validationTargets())

Modified: myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/validation/ModelValidationPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/validation/ModelValidationPhaseListener.java?rev=831628&r1=831627&r2=831628&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/validation/ModelValidationPhaseListener.java
(original)
+++ myfaces/extensions/validator/trunk/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/validation/ModelValidationPhaseListener.java
Sun Nov  1 00:57:10 2009
@@ -107,7 +107,7 @@
             }
 
             if (processedValidationTargets.contains(validationTarget) &&
-                    !modelValidationEntry.isDisplayInline())
+                    !modelValidationEntry.isDisplayMessageInline())
             {
                 continue;
             }
@@ -189,7 +189,7 @@
                 result = results.get(modelValidationEntry.getComponent().getClientId(facesContext));
 
                 constraintViolation = (ConstraintViolation) violationsIterator.next();
-                if (modelValidationEntry.isDisplayInline())
+                if (modelValidationEntry.isDisplayMessageInline())
                 {
                     result.addFacesMessageHolder(createFacesMessageHolderForConstraintViolation(
                             constraintViolation, modelValidationEntry, validationTarget,
true));
@@ -279,14 +279,14 @@
         if (!isDefaultMessage(modelValidationEntry))
         {
             return interpolateValidationErrorMessage(
-                    modelValidationEntry.getMessage(), validationTarget, violation);
+                    modelValidationEntry.getCustomMessage(), validationTarget, violation);
         }
         return violation.getMessage();
     }
 
     private boolean isDefaultMessage(ModelValidationEntry modelValidationEntry)
     {
-        return ModelValidation.DEFAULT_MESSAGE.equals(modelValidationEntry.getMessage());
+        return ModelValidation.DEFAULT_MESSAGE.equals(modelValidationEntry.getCustomMessage());
     }
 
     private String interpolateValidationErrorMessage(String extValInlineMessage,



Mime
View raw message