incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1126547 - /incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java
Date Mon, 23 May 2011 15:46:04 GMT
Author: mbenson
Date: Mon May 23 15:46:04 2011
New Revision: 1126547

URL: http://svn.apache.org/viewvc?rev=1126547&view=rev
Log:
JSF2 implementation of DynamicBeanValidationELHelper#resolve

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java?rev=1126547&r1=1126546&r2=1126547&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java
Mon May 23 15:46:04 2011
@@ -16,8 +16,12 @@
  */
 package org.apache.bval.jsr303.dynamic.extval;
 
+import javax.el.ELContext;
 import javax.el.ValueExpression;
 import javax.faces.context.FacesContext;
+import javax.faces.el.CompositeComponentExpressionHolder;
+
+import org.apache.myfaces.extensions.validator.core.el.ExtValELResolver;
 
 /**
  * JSF-2.0 {@link DynamicBeanValidationELHelper}.
@@ -47,8 +51,19 @@ public class DynamicBeanValidationELHelp
     @Override
     protected void resolve(ValueExpression valueExpression, PathRecordingELResolver elResolver,
         FacesContext facesContext) {
-        // TODO Auto-generated method stub
-
+        ELContext contextWrapper = ExtValELResolver.createContextWrapper(facesContext.getELContext(),
elResolver);
+        @SuppressWarnings("unused")
+        ValueExpression expr = valueExpression;
+        while (true) {
+            valueExpression.setValue(contextWrapper, null);
+            Object baseObject = elResolver.getBaseObject();
+            if (baseObject instanceof CompositeComponentExpressionHolder) {
+                expr = ((CompositeComponentExpressionHolder) baseObject).getExpression(elResolver.getLeafProperty());
+                elResolver.reset();
+                continue;
+            }
+            break;
+        }
     }
 
 }



Mime
View raw message