myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r681740 - in /myfaces/extensions/validator/branches/jsf_1.1: core/src/main/java/org/apache/myfaces/extensions/validator/core/ core/src/main/java/org/apache/myfaces/extensions/validator/util/ validation-modules/property-validation/src/main/j...
Date Fri, 01 Aug 2008 16:29:30 GMT
Author: gpetracek
Date: Fri Aug  1 09:29:30 2008
New Revision: 681740

URL: http://svn.apache.org/viewvc?rev=681740&view=rev
Log:
minor fix and refactoring

Modified:
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValConverter.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ELUtils.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
    myfaces/extensions/validator/branches/jsf_1.1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCrossValidationStrategy.java

Modified: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValConverter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValConverter.java?rev=681740&r1=681739&r2=681740&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValConverter.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValConverter.java
Fri Aug  1 09:29:30 2008
@@ -111,7 +111,7 @@
         }
 
         entry = new ProcessedInformationEntry();
-        entry.setBean(ELUtils.getBeanObject(valueBindingExpression, uiComponent));
+        entry.setBean(ELUtils.getBaseObject(valueBindingExpression, uiComponent));
         entry.setConvertedValue(convertedObject);
         entry.setComponent(uiComponent);
 

Modified: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ELUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ELUtils.java?rev=681740&r1=681739&r2=681740&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ELUtils.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ELUtils.java
Fri Aug  1 09:29:30 2008
@@ -40,11 +40,14 @@
     }
 
     //TODO refactor - problem - static values - jsf 1.2 e.g.: ${value}
-    public static Object getBeanObject(String valueBindingExpression, UIComponent uiComponent)
{
-        return getBeanObject(valueBindingExpression);
+    public static Object getBaseObject(String valueBindingExpression, UIComponent uiComponent)
{
+        if (valueBindingExpression.lastIndexOf(".") == -1) {
+            return uiComponent.getValueBinding("value").getValue(FacesContext.getCurrentInstance());
+        }
+        return getBaseObject(valueBindingExpression);
     }
 
-    public static Object getBeanObject(String valueBindingExpression) {
+    public static Object getBaseObject(String valueBindingExpression) {
         String newExpression = valueBindingExpression.substring(0, valueBindingExpression.lastIndexOf("."))
+ "}";
 
         return getValueOfExpression(FacesContext.getCurrentInstance(), newExpression);

Modified: myfaces/extensions/validator/branches/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/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java?rev=681740&r1=681739&r2=681740&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
Fri Aug  1 09:29:30 2008
@@ -275,7 +275,7 @@
         FacesContext facesContext = FacesContext.getCurrentInstance();
         String clientId = component.getClientId(facesContext);
 
-        if (clientId.substring(clientId.lastIndexOf(":")).endsWith(endOfKey)) {
+        if (clientId.contains(":") && clientId.substring(clientId.lastIndexOf(":")).endsWith(endOfKey))
{
             return component;
         }
 

Modified: myfaces/extensions/validator/branches/jsf_1.1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCrossValidationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCrossValidationStrategy.java?rev=681740&r1=681739&r2=681740&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCrossValidationStrategy.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCrossValidationStrategy.java
Fri Aug  1 09:29:30 2008
@@ -44,7 +44,7 @@
         CrossValidationStorageEntry entry = new CrossValidationStorageEntry();
 
         entry.setAnnotationEntry(annotationEntry);
-        entry.setBean(ELUtils.getBeanObject(annotationEntry.getValueBindingExpression()));
+        entry.setBean(ELUtils.getBaseObject(annotationEntry.getValueBindingExpression()));
         entry.setComponent(uiComponent);
         entry.setConvertedObject(convertedObject);
         entry.setValidationStrategy(this);



Mime
View raw message