Author: pete.muir(a)jboss.org
Date: 2008-05-09 10:31:39 -0400 (Fri, 09 May 2008)
New Revision: 8518
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm
Log:
RF-3379
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm 2008-05-09
14:21:48 UTC (rev 8517)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm 2008-05-09
14:31:39 UTC (rev 8518)
@@ -17,7 +17,6 @@
import javax.faces.convert.Converter;
import javax.faces.webapp.UIComponentTag;
import javax.faces.context.FacesContext;
-import org.apache.commons.beanutils.ConvertUtils;
import javax.servlet.jsp.JspException;
import ${converter.classname};
@@ -42,20 +41,19 @@
if (_${prop.name} != null)
{
#if( ${prop.el} )
- if (UIComponentTag.isValueReference(_${prop.name}))
+ if (_${prop.name} instanceof ValueExpression)
{
- ValueBinding vb =
facesContext.getApplication().createValueBinding(_${prop.name});
- converter.${prop.setterName}((${prop.simpleClassName})
vb.getValue(facesContext));
+ converter.${prop.setterName}((${prop.simpleClassName})
_${prop.name}.getValue(facesContext.getELContext()));
}
-#if (!${prop.elonly})
- else
+#if (${prop.elonly})
+ if(null != this._${prop.name} && this._${prop.name}.isLiteralText())
{
- converter.${prop.setterName}((${prop.simpleClassName})
ConvertUtils.convert(_${prop.name}, ${prop.simpleClassName}.class));
- }
+ throw new IllegalArgumentException("Converter ${converter.name} allows only EL
expressions for property ${prop.name}");
+ }
#end
}
#else
- converter.${prop.setterName}((${prop.simpleClassName})
ConvertUtils.convert(_${prop.name}, ${prop.simpleClassName}.class));
+ converter.${prop.setterName}((${prop.simpleClassName}) _${prop.name});
#end
#end
#end
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm 2008-05-09
14:21:48 UTC (rev 8517)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm 2008-05-09
14:31:39 UTC (rev 8518)
@@ -37,16 +37,15 @@
if (_${prop.name} != null)
{
#if( ${prop.el} )
- if (UIComponentTag.isValueReference(_${prop.name}))
+ if (_${prop.name} instanceof ValueExpression)
{
- ValueBinding vb =
facesContext.getApplication().createValueBinding(_${prop.name});
- validator.${prop.setterName}((${prop.simpleClassName})
vb.getValue(facesContext));
+ validator.${prop.setterName}((${prop.simpleClassName})
_${prop.name}.getValue(facesContext.getELContext()));
}
-#if (!${prop.elonly})
- else
+#if (${prop.elonly})
+ if(null != this._${prop.name} && this._${prop.name}.isLiteralText())
{
- validator.${prop.setterName}((${prop.simpleClassName})
ConvertUtils.convert(_${prop.name}, ${prop.simpleClassName}.class));
- }
+ throw new IllegalArgumentException("Validator ${validator.name} allows only EL
expressions for property ${prop.name}");
+ }
#end
}
#else
Show replies by date