incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r466171 - in /incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin: ./ src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/ src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ src/main/resources/org...
Date Fri, 20 Oct 2006 16:22:05 GMT
Author: awiner
Date: Fri Oct 20 09:22:04 2006
New Revision: 466171

URL: http://svn.apache.org/viewvc?view=rev&rev=466171
Log:
Merge back JSF 1.2 modifications, one step at a time.  Having svn problems with some files

Added:
    incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
      - copied unchanged from r466160, incubator/adffaces/branches/faces-1_2/plugins/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
Modified:
    incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/pom.xml
    incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFacesConfigMojo.java
    incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
    incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
    incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java

Modified: incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/pom.xml?view=diff&rev=466171&r1=466170&r2=466171
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/pom.xml (original)
+++ incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/pom.xml Fri Oct 20 09:22:04 2006
@@ -9,7 +9,7 @@
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
   <artifactId>maven-faces-plugin</artifactId> 
-  <version>incubator-m1-SNAPSHOT</version>
+  <version>incubator-1.2-m1-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
   <name>Maven Faces Plugin</name>
 

Modified: incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFacesConfigMojo.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFacesConfigMojo.java?view=diff&rev=466171&r1=466170&r2=466171
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFacesConfigMojo.java (original)
+++ incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFacesConfigMojo.java Fri Oct 20 09:22:04 2006
@@ -159,7 +159,12 @@
 
           Result mergedResult = new StreamResult(resultStream);
 
-          URL xslURL = getClass().getResource("resources/transform.xsl");
+          URL xslURL;
+          if (_is12())
+            xslURL = getClass().getResource("resources/transform12.xsl");
+          else
+            xslURL = getClass().getResource("resources/transform.xsl");
+
           InputStream xsl = xslURL.openStream();
           StreamSource xslSource = new StreamSource(xsl);
           Transformer transformer = transFactory.newTransformer(xslSource);
@@ -217,6 +222,12 @@
     }
   }
 
+  private boolean _is12()
+  {
+    return "1.2".equals(jsfVersion) || "12".equals(jsfVersion);
+  }
+
+
   /**
    * @parameter expression="${project}"
    * @readonly
@@ -239,6 +250,7 @@
    */
   private String packageContains = "";
 
+
   /**
    * @parameter expression="${project.build.directory}/maven-faces-plugin/main/resources"
    * @required
@@ -268,4 +280,9 @@
    * @parameter
    */
   private String transformStylesheet;
+
+  /**
+   * @parameter
+   */
+  private String jsfVersion;
 }

Modified: incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java?view=diff&rev=466171&r1=466170&r2=466171
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java (original)
+++ incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java Fri Oct 20 09:22:04 2006
@@ -28,6 +28,7 @@
 import java.lang.reflect.Modifier;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -216,7 +217,7 @@
           XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
           XMLStreamWriter stream = outputFactory.createXMLStreamWriter(out);
 
-          _writeStartTagLibrary(stream, "1.2", shortName, namespaceURI);
+          _writeStartTagLibrary(stream, _is12() ? "2.1" : "1.2", shortName, namespaceURI);
           while (components.hasNext())
           {
             ComponentBean component = (ComponentBean)components.next();
@@ -276,9 +277,18 @@
   {
     stream.writeStartDocument("1.0");
     stream.writeCharacters("\n");
-    stream.writeDTD(dtd);
+    if (!_is12())
+      stream.writeDTD(dtd);
     stream.writeCharacters("\n");
     stream.writeStartElement("taglib");
+    if (_is12())
+    {
+      stream.writeNamespace("", "http://java.sun.com/xml/ns/javaee");
+      stream.writeNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+      stream.writeAttribute("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd");
+      stream.writeAttribute("version", "2.1");
+    }
+
     stream.writeCharacters("\n  ");
   }
 
@@ -327,13 +337,6 @@
     stream.writeCharacters("\n  ");
     stream.writeStartElement("tag");
     stream.writeCharacters("\n    ");
-    stream.writeStartElement("name");
-    stream.writeCharacters(component.getTagName().getLocalPart());
-    stream.writeEndElement();
-    stream.writeCharacters("\n    ");
-    stream.writeStartElement("tag-class");
-    stream.writeCharacters(component.getTagClass());
-    stream.writeEndElement();
     if (component.getDescription() != null)
     {
       stream.writeCharacters("\n    ");
@@ -342,6 +345,14 @@
       stream.writeEndElement();
     }
 
+    stream.writeStartElement("name");
+    stream.writeCharacters(component.getTagName().getLocalPart());
+    stream.writeEndElement();
+    stream.writeCharacters("\n    ");
+    stream.writeStartElement("tag-class");
+    stream.writeCharacters(component.getTagClass());
+    stream.writeEndElement();
+
     Iterator properties = component.properties(true);
     properties = new FilteredIterator(properties, new TagAttributeFilter());
     while (properties.hasNext())
@@ -350,7 +361,8 @@
       _writeTagAttribute(stream,
                          property.getPropertyName(),
                          property.getDescription(),
-                         property.getUnsupportedAgents());
+                         property.getUnsupportedAgents(),
+                         property);
     }
 
     stream.writeCharacters("\n  ");
@@ -367,13 +379,6 @@
     stream.writeCharacters("\n  ");
     stream.writeStartElement("tag");
     stream.writeCharacters("\n    ");
-    stream.writeStartElement("name");
-    stream.writeCharacters(converter.getTagName().getLocalPart());
-    stream.writeEndElement();
-    stream.writeCharacters("\n    ");
-    stream.writeStartElement("tag-class");
-    stream.writeCharacters(converter.getTagClass());
-    stream.writeEndElement();
     if (converter.getDescription() != null)
     {
       stream.writeCharacters("\n    ");
@@ -382,8 +387,16 @@
       stream.writeEndElement();
     }
 
+    stream.writeStartElement("name");
+    stream.writeCharacters(converter.getTagName().getLocalPart());
+    stream.writeEndElement();
+    stream.writeCharacters("\n    ");
+    stream.writeStartElement("tag-class");
+    stream.writeCharacters(converter.getTagClass());
+    stream.writeEndElement();
+
     // converters need an id attribute
-    _writeTagAttribute(stream, "id", "the identifier for the component", null);
+    _writeTagAttribute(stream, "id", "the identifier for the component", null, null);
 
     Iterator properties = converter.properties();
     properties = new FilteredIterator(properties, new TagAttributeFilter());
@@ -393,7 +406,8 @@
       _writeTagAttribute(stream,
                          property.getPropertyName(),
                          property.getDescription(),
-                         property.getUnsupportedAgents());
+                         property.getUnsupportedAgents(),
+                         property);
     }
 
     stream.writeCharacters("\n  ");
@@ -404,21 +418,12 @@
     XMLStreamWriter stream,
     String          propertyName,
     String          description,
-    String[]        unsupportedAgents) throws XMLStreamException
+    String[]        unsupportedAgents,
+    PropertyBean    property) throws XMLStreamException
   {
     stream.writeCharacters("\n    ");
     stream.writeStartElement("attribute");
 
-    stream.writeCharacters("\n      ");
-    stream.writeStartElement("name");
-    stream.writeCharacters(propertyName);
-    stream.writeEndElement();
-
-    stream.writeCharacters("\n      ");
-    stream.writeStartElement("rtexprvalue");
-    stream.writeCharacters("false");
-    stream.writeEndElement();
-
     if (description != null ||
         unsupportedAgents.length > 0)
     {
@@ -444,6 +449,78 @@
       stream.writeEndElement();
     }
 
+    stream.writeCharacters("\n      ");
+    stream.writeStartElement("name");
+    
+    if (property != null)
+      stream.writeCharacters(property.getJspPropertyName());
+    else
+      stream.writeCharacters(propertyName);
+
+    stream.writeEndElement();
+
+    if (!_is12())
+    {
+      stream.writeCharacters("\n      ");
+      stream.writeStartElement("rtexprvalue");
+      stream.writeCharacters("false");
+      stream.writeEndElement();
+    }
+    else
+    {
+      if (property != null)
+      {
+        if (property.isRequired())
+        {
+          stream.writeCharacters("\n    ");
+          stream.writeStartElement("required");
+          stream.writeCharacters("true");
+          stream.writeEndElement();
+        }
+        
+        if (property.isMethodExpression() || property.isMethodBinding())
+        {
+          stream.writeCharacters("\n    ");
+          stream.writeStartElement("deferred-method");
+          stream.writeCharacters("\n      ");
+          MethodSignatureBean sig = property.getMethodBindingSignature();
+          if (sig != null)
+          {
+            stream.writeStartElement("method-signature");
+            stream.writeCharacters(sig.getReturnType());
+            stream.writeCharacters(" myMethod(");
+            String[] params = sig.getParameterTypes();
+            for (int i = 0; i < params.length; i++)
+            {
+              if (i > 0)
+                stream.writeCharacters(", ");
+              stream.writeCharacters(params[i]);
+              stream.writeCharacters(" a" + i);
+            }
+
+            stream.writeCharacters(")");
+            stream.writeEndElement();
+          }
+          stream.writeEndElement();
+        }
+        else if (!property.isLiteralOnly())
+        {
+          stream.writeCharacters("\n    ");
+          stream.writeStartElement("deferred-value");
+          if (_CAN_COERCE.contains(property.getPropertyClass()))
+          {
+            stream.writeCharacters("\n      ");
+            stream.writeStartElement("type");
+            stream.writeCharacters(property.getPropertyClass());
+            stream.writeEndElement();
+            stream.writeCharacters("\n    ");
+          }
+
+          stream.writeEndElement();
+        }
+      }
+    }
+
     stream.writeCharacters("\n    ");
     stream.writeEndElement();
   }
@@ -474,7 +551,7 @@
     }
 
     // validators need an id attribute
-    _writeTagAttribute(stream, "id", "the identifier for the component", null);
+    _writeTagAttribute(stream, "id", "the identifier for the component", null, null);
 
     Iterator properties = validator.properties();
     properties = new FilteredIterator(properties, new TagAttributeFilter());
@@ -484,7 +561,8 @@
       _writeTagAttribute(stream,
                          property.getPropertyName(),
                          property.getDescription(),
-                         property.getUnsupportedAgents());
+                         property.getUnsupportedAgents(),
+                         property);
     }
 
     stream.writeCharacters("\n  ");
@@ -594,8 +672,17 @@
         out.println(" * Auto-generated tag class.");
         out.println(" */");
 
-        out.println("public class " + className +
-                          " extends ConverterTag");
+        if (_is12())
+        {
+          out.println("public class " + className +
+                      " extends ConverterELTag");
+        }
+        else
+        {
+          out.println("public class " + className +
+                      " extends ConverterTag");
+        }
+
         out.println("{");
         out.indent();
 
@@ -633,7 +720,15 @@
     {
       Set imports = new TreeSet();
 
-      imports.add("javax.faces.webapp.ConverterTag");
+      if (_is12())
+      {
+        imports.add("javax.faces.webapp.ConverterELTag");
+        imports.add("javax.faces.context.FacesContext");
+        imports.add("javax.faces.application.Application");
+      }
+      else
+        imports.add("javax.faces.webapp.ConverterTag");
+        
       imports.add("javax.servlet.jsp.JspException");
       imports.add(converter.getConverterClass());
 
@@ -642,7 +737,10 @@
       if (properties.hasNext())
       {
         imports.add("javax.faces.convert.Converter");
-        imports.add("javax.faces.el.ValueBinding");
+        if (_is12())
+          imports.add("javax.el.ValueExpression");
+        else
+          imports.add("javax.faces.el.ValueBinding");
         imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
       }
 
@@ -706,7 +804,9 @@
     {
       String propName = property.getPropertyName();
       String propVar = "_" + Util.getVariableFromName(propName);
-      out.println("private String " + propVar + ";");
+      String jspPropType = _getJspPropertyType(property);
+
+      out.println("private " + jspPropType + " " + propVar + ";");
     }
 
     private void _writePropertySet(
@@ -716,9 +816,10 @@
       String propName = property.getPropertyName();
       String propVar = Util.getVariableFromName(propName);
       String setMethod = Util.getPrefixedPropertyName("set", propName);
+      String jspPropType = _getJspPropertyType(property);
 
       // TODO: restore coding standards, and make final
-      out.println("public void " + setMethod + "(String " + propVar + ")");
+      out.println("public void " + setMethod + "(" + jspPropType + " " + propVar + ")");
       out.println("{");
       out.indent();
       out.println("_" + propVar + " = " + propVar + ";");
@@ -730,19 +831,22 @@
       PrettyWriter  out,
       ConverterBean converter) throws IOException
     {
-      String converterFullClass = converter.getConverterClass();
-      String converterClass = Util.getClassFromFullClass(converterFullClass);
-
-      out.println();
-      // TODO: restore coding standards, and make final
-      out.println("@Override");
-      out.println("public int doStartTag() throws JspException");
-      out.println("{");
-      out.indent();
-      out.println("super.setConverterId(" + converterClass + ".CONVERTER_ID);");
-      out.println("return super.doStartTag();");
-      out.unindent();
-      out.println("}");
+      if (!_is12())
+      {
+        String converterFullClass = converter.getConverterClass();
+        String converterClass = Util.getClassFromFullClass(converterFullClass);
+        
+        out.println();
+        // TODO: restore coding standards, and make final
+        out.println("@Override");
+        out.println("public int doStartTag() throws JspException");
+        out.println("{");
+        out.indent();
+        out.println("super.setConverterId(" + converterClass + ".CONVERTER_ID);");
+        out.println("return super.doStartTag();");
+        out.unindent();
+        out.println("}");
+      }
     }
 
     private void _writeCreateConverter(
@@ -762,8 +866,18 @@
         out.println("protected Converter createConverter() throws JspException");
         out.println("{");
         out.indent();
-        out.println(converterClass + " converter = " +
-                    "(" + converterClass + ")super.createConverter();");
+        if (_is12())
+        {
+          out.println("String converterId = " + converterClass +  ".CONVERTER_ID;");
+          out.println("Application appl = FacesContext.getCurrentInstance().getApplication();");
+          out.println(converterClass + " converter = " +
+                      "(" + converterClass + ")appl.createConverter(converterId);");
+        }
+        else
+        {
+          out.println(converterClass + " converter = " +
+                      "(" + converterClass + ")super.createConverter();");
+        }
         out.println("_setProperties(converter);");
         out.println("return converter;");
         out.unindent();
@@ -806,44 +920,89 @@
       String propFullClass = property.getPropertyClass();
       String propClass = Util.getClassFromFullClass(propFullClass);
       String propVar = "_" + Util.getVariableFromName(propName);
+
       out.println("if (" + propVar + " != null)");
       out.println("{");
       out.indent();
-      out.println("if (TagUtils.isValueReference(" + propVar + "))");
-      out.println("{");
-      out.indent();
-      out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
-      out.println("converter.setValueBinding(\"" + propName + "\", vb);");
-      out.unindent();
-      out.println("}");
-      String propType = _resolveType(propFullClass);
-      if (propType != null)
+
+      if (_is12())
       {
-        out.println("else");
+        out.println("if (!" + propVar + ".isLiteralText())");
         out.println("{");
         out.indent();
-        if ("StringArray".equals(propType))
+        out.println("converter.setValueExpression(\"" + propName + "\", " +
+                    propVar + ");");
+        out.unindent();
+        out.println("}");
+        String propType = _resolveType(propFullClass);
+        if (propType != null)
         {
-          out.println("try");
+          out.println("else");
           out.println("{");
+          out.indent();
+          if ("StringArray".equals(propType))
+          {
+            out.println("try");
+            out.println("{");
+          }
+          
+          out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
+          String setMethod = Util.getPrefixedPropertyName("set", propName);
+          out.println("converter." + setMethod + "(value);");
+          if ("StringArray".equals(propType))
+          {
+            out.println("}");
+            out.println("catch (ParseException pe)");
+            out.println("{");
+            out.indent();
+            out.println("throw new JspException(");
+            out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+            out.unindent();
+            out.println("}");
+          }
+          out.unindent();
+          out.println("}");
         }
-        out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
-        String setMethod = Util.getPrefixedPropertyName("set", propName);
-        out.println("converter." + setMethod + "(value);");
-        if ("StringArray".equals(propType))
+      }
+      else
+      {
+        out.println("if (TagUtils.isValueReference(" + propVar + "))");
+        out.println("{");
+        out.indent();
+        out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
+        out.println("converter.setValueBinding(\"" + propName + "\", vb);");
+        out.unindent();
+        out.println("}");
+        String propType = _resolveType(propFullClass);
+        if (propType != null)
         {
-          out.println("}");
-          out.println("catch (ParseException pe)");
+          out.println("else");
           out.println("{");
           out.indent();
-          out.println("throw new JspException(");
-          out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+          if ("StringArray".equals(propType))
+          {
+            out.println("try");
+            out.println("{");
+          }
+          out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+          String setMethod = Util.getPrefixedPropertyName("set", propName);
+          out.println("converter." + setMethod + "(value);");
+          if ("StringArray".equals(propType))
+          {
+            out.println("}");
+            out.println("catch (ParseException pe)");
+            out.println("{");
+            out.indent();
+            out.println("throw new JspException(");
+            out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+            out.unindent();
+            out.println("}");
+          }
           out.unindent();
           out.println("}");
         }
-        out.unindent();
-        out.println("}");
       }
+
       out.unindent();
       out.println("}");
     }
@@ -873,6 +1032,19 @@
         out.println("}");
       }
     }
+
+    private String _getJspPropertyType(PropertyBean property)
+    {
+      if (property.isMethodExpression())
+        return "MethodExpression";
+
+      if (_is12() && property.isMethodBinding())
+        return "MethodExpression";
+
+      if (_is12() && !property.isLiteralOnly())
+        return "ValueExpression";
+      return "String";
+    }
   }
 
   class ValidatorTagGenerator
@@ -910,8 +1082,17 @@
         out.println(" * Auto-generated tag class.");
         out.println(" */");
 
-        out.println("public class " + className +
-                          " extends ValidatorTag");
+        if (_is12())
+        {
+          out.println("public class " + className +
+                      " extends ValidatorELTag");
+        }
+        else
+        {
+          out.println("public class " + className +
+                      " extends ValidatorTag");
+        }
+
         out.println("{");
         out.indent();
 
@@ -949,7 +1130,15 @@
     {
       Set imports = new TreeSet();
 
-      imports.add("javax.faces.webapp.ValidatorTag");
+      if (_is12())
+      {
+        imports.add("javax.faces.webapp.ValidatorELTag");
+        imports.add("javax.faces.context.FacesContext");
+        imports.add("javax.faces.application.Application");
+      }
+      else
+        imports.add("javax.faces.webapp.ValidatorTag");
+
       imports.add("javax.servlet.jsp.JspException");
       imports.add(validator.getValidatorClass());
 
@@ -958,7 +1147,10 @@
       if (properties.hasNext())
       {
         imports.add("javax.faces.validator.Validator");
-        imports.add("javax.faces.el.ValueBinding");
+        if (_is12())
+          imports.add("javax.el.ValueExpression");
+        else
+          imports.add("javax.faces.el.ValueBinding");
         imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
       }
 
@@ -1022,7 +1214,9 @@
     {
       String propName = property.getPropertyName();
       String propVar = "_" + Util.getVariableFromName(propName);
-      out.println("private String " + propVar + ";");
+      String jspPropType = _getJspPropertyType(property);
+
+      out.println("private " + jspPropType + " " + propVar + ";");
     }
 
     private void _writePropertySet(
@@ -1032,9 +1226,10 @@
       String propName = property.getPropertyName();
       String propVar = Util.getVariableFromName(propName);
       String setMethod = Util.getPrefixedPropertyName("set", propName);
+      String jspPropType = _getJspPropertyType(property);
 
       // TODO: restore coding standards, and make final
-      out.println("public void " + setMethod + "(String " + propVar + ")");
+      out.println("public void " + setMethod + "(" + jspPropType + " " + propVar + ")");
       out.println("{");
       out.indent();
       out.println("_" + propVar + " = " + propVar + ";");
@@ -1046,19 +1241,22 @@
       PrettyWriter  out,
       ValidatorBean validator) throws IOException
     {
-      String validatorFullClass = validator.getValidatorClass();
-      String validatorClass = Util.getClassFromFullClass(validatorFullClass);
-
       out.println();
-      // TODO: restore coding standards, and make final
-      out.println("@Override");
-      out.println("public int doStartTag() throws JspException");
-      out.println("{");
-      out.indent();
-      out.println("super.setValidatorId(" + validatorClass + ".VALIDATOR_ID);");
-      out.println("return super.doStartTag();");
-      out.unindent();
-      out.println("}");
+      if (!_is12())
+      {
+        String validatorFullClass = validator.getValidatorClass();
+        String validatorClass = Util.getClassFromFullClass(validatorFullClass);
+
+        // TODO: restore coding standards, and make final
+        out.println("@Override");
+        out.println("public int doStartTag() throws JspException");
+        out.println("{");
+        out.indent();
+        out.println("super.setValidatorId(" + validatorClass + ".VALIDATOR_ID);");
+        out.println("return super.doStartTag();");
+        out.unindent();
+        out.println("}");
+      }
     }
 
     private void _writeCreateValidator(
@@ -1078,8 +1276,18 @@
         out.println("protected Validator createValidator() throws JspException");
         out.println("{");
         out.indent();
-        out.println(validatorClass + " validator = " +
-                    "(" + validatorClass + ")super.createValidator();");
+        if (_is12())
+        {
+          out.println("String validatorId = " + validatorClass + ".VALIDATOR_ID;");
+          out.println("Application appl = FacesContext.getCurrentInstance().getApplication();");
+          out.println(validatorClass + " validator = " +
+                      "(" + validatorClass + ")appl.createValidator(validatorId);");
+        }
+        else
+        {
+          out.println(validatorClass + " validator = " +
+                      "(" + validatorClass + ")super.createValidator();");
+        }
         out.println("_setProperties(validator);");
         out.println("return validator;");
         out.unindent();
@@ -1125,41 +1333,84 @@
       out.println("if (" + propVar + " != null)");
       out.println("{");
       out.indent();
-      out.println("if (TagUtils.isValueReference(" + propVar + "))");
-      out.println("{");
-      out.indent();
-      out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
-      out.println("validator.setValueBinding(\"" + propName + "\", vb);");
-      out.unindent();
-      out.println("}");
-      String propType = _resolveType(propFullClass);
-      if (propType != null)
+      if (_is12())
       {
-        out.println("else");
+        out.println("if (!" + propVar + ".isLiteralText())");
         out.println("{");
         out.indent();
-        if ("StringArray".equals(propType))
+        out.println("validator.setValueExpression(\"" + propName + "\", " +
+                    propVar + ");");
+        out.unindent();
+        out.println("}");
+        String propType = _resolveType(propFullClass);
+        if (propType != null)
         {
-          out.println("try");
+          out.println("else");
           out.println("{");
+          out.indent();
+          if ("StringArray".equals(propType))
+          {
+            out.println("try");
+            out.println("{");
+          }
+          
+          out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
+          String setMethod = Util.getPrefixedPropertyName("set", propName);
+          out.println("validator." + setMethod + "(value);");
+          if ("StringArray".equals(propType))
+          {
+            out.println("}");
+            out.println("catch (ParseException pe)");
+            out.println("{");
+            out.indent();
+            out.println("throw new JspException(");
+            out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+            out.unindent();
+            out.println("}");
+          }
+          out.unindent();
+          out.println("}");
         }
-        out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
-        String setMethod = Util.getPrefixedPropertyName("set", propName);
-        out.println("validator." + setMethod + "(value);");
-        if ("StringArray".equals(propType))
+      }
+      else
+      {
+        out.println("if (TagUtils.isValueReference(" + propVar + "))");
+        out.println("{");
+        out.indent();
+        out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
+        out.println("validator.setValueBinding(\"" + propName + "\", vb);");
+        out.unindent();
+        out.println("}");
+        String propType = _resolveType(propFullClass);
+        if (propType != null)
         {
-          out.println("}");
-          out.println("catch (ParseException pe)");
+          out.println("else");
           out.println("{");
           out.indent();
-          out.println("throw new JspException(");
-          out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+          if ("StringArray".equals(propType))
+          {
+            out.println("try");
+            out.println("{");
+          }
+          out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+          String setMethod = Util.getPrefixedPropertyName("set", propName);
+          out.println("validator." + setMethod + "(value);");
+          if ("StringArray".equals(propType))
+          {
+            out.println("}");
+            out.println("catch (ParseException pe)");
+            out.println("{");
+            out.indent();
+            out.println("throw new JspException(");
+            out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+            out.unindent();
+            out.println("}");
+          }
           out.unindent();
           out.println("}");
         }
-        out.unindent();
-        out.println("}");
       }
+
       out.unindent();
       out.println("}");
     }
@@ -1189,6 +1440,19 @@
         out.println("}");
       }
     }
+
+    private String _getJspPropertyType(PropertyBean property)
+    {
+      if (property.isMethodExpression())
+        return "MethodExpression";
+
+      if (_is12() && property.isMethodBinding())
+        return "MethodExpression";
+
+      if (_is12() && !property.isLiteralOnly())
+        return "ValueExpression";
+      return "String";
+    }
   }
 
   class ComponentTagGenerator
@@ -1321,35 +1585,64 @@
           imports.add(propertyClass);
         }
 
+        imports.add("javax.el.ValueExpression");
+
         if (_isKeyStroke(propertyClass))
         {
-          imports.add("javax.faces.el.ValueBinding");
+          if (_is12())
+            imports.add("javax.el.ValueExpression");
+          else
+            imports.add("javax.faces.el.ValueBinding");
           imports.add("javax.swing.KeyStroke");
         }
         else if (_isAWTKeyStroke(propertyClass))
         {
-          imports.add("javax.faces.el.ValueBinding");
+          if (_is12())
+            imports.add("javax.el.ValueExpression");
+          else
+            imports.add("javax.faces.el.ValueBinding");
           imports.add("java.awt.AWTKeyStroke");
         }
         else if (_isConverter(propertyClass))
         {
-          imports.add("javax.faces.el.ValueBinding");
+          if (_is12())
+            imports.add("javax.el.ValueExpression");
+          else
+            imports.add("javax.faces.el.ValueBinding");
           imports.add("javax.faces.convert.Converter");
         }
         else if (property.isVirtual())
         {
-          imports.add("javax.faces.el.ValueBinding");
+          if (_is12())
+            imports.add("javax.el.ValueExpression");
+          else
+            imports.add("javax.faces.el.ValueBinding");
           imports.add("org.apache.myfaces.trinidadinternal.taglib.util.VirtualAttributeUtils");
         }
         else if (_isColorList(propertyClass, propertyClassParams))
         {
-          imports.add("javax.faces.el.ValueBinding");
+          if (_is12())
+            imports.add("javax.el.ValueExpression");
+          else
+            imports.add("javax.faces.el.ValueBinding");
           imports.add("java.text.ParseException");
           imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
         }
         else if (property.isMethodBinding())
         {
-          imports.add("javax.faces.el.MethodBinding");
+          if (_is12())
+          {
+            imports.add("javax.el.MethodExpression");
+            imports.add("org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding");
+          }
+          else
+          {
+            imports.add("javax.faces.el.MethodBinding");
+          }
+        }
+        else if (property.isMethodExpression())
+        {
+          imports.add("javax.el.MethodExpression");
         }
 
         // TODO: restore import and make reference to
@@ -1483,7 +1776,22 @@
     {
       String propName = property.getPropertyName();
       String propVar = "_" + Util.getVariableFromName(propName);
-      out.println("private String " + propVar + ";");
+      String jspPropType = _getJspPropertyType(property);
+      
+      out.println("private " + jspPropType + " " + propVar + ";");
+    }
+
+    private String _getJspPropertyType(PropertyBean property)
+    {
+      if (property.isMethodExpression())
+        return "MethodExpression";
+
+      if (_is12() && property.isMethodBinding())
+        return "MethodExpression";
+
+      if (_is12() && !property.isLiteralOnly())
+        return "ValueExpression";
+      return "String";
     }
 
     private void _writePropertySet(
@@ -1491,11 +1799,13 @@
      PropertyBean  property) throws IOException
     {
       String propName = property.getPropertyName();
+      String jspPropName = property.getJspPropertyName();
       String propVar = Util.getVariableFromName(propName);
-      String setMethod = Util.getPrefixedPropertyName("set", propName);
+      String setMethod = Util.getPrefixedPropertyName("set", jspPropName);
+      String jspPropType = _getJspPropertyType(property);
 
       // TODO: restore coding standards, and make final
-      out.println("public void " + setMethod + "(String " + propVar + ")");
+      out.println("public void " + setMethod + "(" + jspPropType + " " + propVar + ")");
       out.println("{");
       out.indent();
       out.println("_" + propVar + " = " + propVar + ";");
@@ -1550,6 +1860,10 @@
       {
         _writeSetMethodBinding(out, componentClass, property);
       }
+      else if (property.isMethodExpression())
+      {
+        _writeSetMethodExpression(out, componentClass, property);
+      }
       else if (_isKeyStroke(propClass))
       {
         _writeSetKeyStroke(out, componentClass, propName);
@@ -1646,11 +1960,25 @@
       PrettyWriter out,
       String       componentClass,
       String       propName,
-      String       propClass,
+      String       propFullClass,
       String       propVar)
     {
+      String propClass = Util.getClassFromFullClass(propFullClass);
+      String boxedClass = Util.getBoxedClass(propClass);
+      if ((!_is12() && !boxedClass.equals(propClass)) ||
+           "java.util.Date".equals(propFullClass) ||
+          (boxedClass.indexOf("[]") != -1))
+      {
         // TODO: reject value binding expressions for literal-only
-      _writeSetProperty(out, componentClass, propName, propClass, propVar);
+        _writeSetProperty(out, componentClass, propName, propFullClass, propVar);
+      }
+      else
+      {
+        String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+        out.println("bean.setProperty(" +
+                    componentClass + "." + propKey + ", " +
+                    propVar + ");" );
+       }
     }
 
     private void _writeSetProperty(
@@ -1664,13 +1992,14 @@
       String propClass = Util.getClassFromFullClass(propFullClass);
       String boxedClass = Util.getBoxedClass(propClass);
       String setProperty = "setProperty";
-      if (!boxedClass.equals(propClass) ||
+      if ((!_is12() && !boxedClass.equals(propClass)) ||
            "java.util.Date".equals(propFullClass) ||
           (boxedClass.indexOf("[]") != -1))
       {
         String propType = boxedClass.replaceAll("\\[\\]", "Array");
         setProperty = Util.getPrefixedPropertyName("set", propType + "Property");
       }
+      
       out.println(setProperty + "(bean, " +
                                   componentClass + "." + propKey + ", " +
                                   propVar + ");" );
@@ -1698,31 +2027,67 @@
       out.println("if (" + propVar + " != null)");
       out.println("{");
       out.indent();
-      out.println("if (isValueReference(" + propVar + "))");
-      out.println("{");
-      out.indent();
-      out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
-      out.println("VirtualAttributeUtils.setAccessKeyAttribute(");
-      out.indent();
-      out.println("bean,");
-      out.println("vb,");
-      out.println(propKeys[0] + ",");
-      out.println(propKeys[1] +  ");");
-      out.unindent();
-      out.unindent();
-      out.println("}");
-      out.println("else");
-      out.println("{");
-      out.indent();
-      out.println("VirtualAttributeUtils.setAccessKeyAttribute(");
-      out.indent();
-      out.println("bean,");
-      out.println(propVar + ",");
-      out.println(propKeys[0] + ",");
-      out.println(propKeys[1] +  ");");
-      out.unindent();
-      out.unindent();
-      out.println("}");
+
+      if (_is12())
+      {
+        out.println("if (!" + propVar + ".isLiteralText())");
+        out.println("{");
+        out.indent();
+        out.println("VirtualAttributeUtils.setAccessKeyAttribute(");
+        out.indent();
+        out.println("bean,");
+        out.println(propVar + ",");
+        out.println(propKeys[0] + ",");
+        out.println(propKeys[1] +  ");");
+        out.unindent();
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("Object o = " + propVar + ".getValue(null);");
+        out.println("if (o != null)");
+        out.indent();
+        out.println("VirtualAttributeUtils.setAccessKeyAttribute(");
+        out.indent();
+        out.println("bean,");
+        out.println("o.toString(),");
+        out.println(propKeys[0] + ",");
+        out.println(propKeys[1] +  ");");
+        out.unindent();
+        out.unindent();
+        out.unindent();
+        out.println("}");
+      }
+      else
+      {
+        out.println("if (isValueReference(" + propVar + "))");
+        out.println("{");
+        out.indent();
+        out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+        out.println("VirtualAttributeUtils.setAccessKeyAttribute(");
+        out.indent();
+        out.println("bean,");
+        out.println("vb,");
+        out.println(propKeys[0] + ",");
+        out.println(propKeys[1] +  ");");
+        out.unindent();
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("VirtualAttributeUtils.setAccessKeyAttribute(");
+        out.indent();
+        out.println("bean,");
+        out.println(propVar + ",");
+        out.println(propKeys[0] + ",");
+        out.println(propKeys[1] +  ");");
+        out.unindent();
+        out.unindent();
+        out.println("}");
+      }
+
       out.unindent();
       out.println("}");
     }
@@ -1736,89 +2101,142 @@
       String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
       String propVar = "_" + propName;
 
-      MethodSignatureBean signature = property.getMethodBindingSignature();
-      String[] paramTypes = (signature != null) ? signature.getParameterTypes() : null;
-
-      String classArray;
-
-      if (paramTypes == null || paramTypes.length == 0)
+      if (_is12())
       {
-        classArray = "new Class[0]";
+        out.println("if (" + propVar + " != null)");
+        out.indent();
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ", " +
+                    "new MethodExpressionMethodBinding(" + propVar + "));");
+        out.unindent();
       }
       else
       {
-        StringBuffer sb = new StringBuffer();
-        sb.append("new Class[]{");
-        for (int i=0; i < paramTypes.length; i++)
+        MethodSignatureBean signature = property.getMethodBindingSignature();
+        String[] paramTypes = (signature != null) ? signature.getParameterTypes() : null;
+        
+        String classArray;
+        
+        if (paramTypes == null || paramTypes.length == 0)
+        {
+          classArray = "new Class[0]";
+        }
+        else
+        {
+          StringBuffer sb = new StringBuffer();
+          sb.append("new Class[]{");
+          for (int i=0; i < paramTypes.length; i++)
+          {
+            if (i > 0)
+              sb.append(',');
+            sb.append(paramTypes[i]);
+            sb.append(".class");
+          }
+          
+          // TODO: remove trailing comma
+          sb.append(',');
+          
+          sb.append('}');
+          classArray = sb.toString();
+        }
+        
+        out.println("if (" + propVar + " != null)");
+        out.println("{");
+        out.indent();
+        
+        if (isStringMethodBindingReturnType(signature))
         {
-          if (i > 0)
-            sb.append(',');
-          sb.append(paramTypes[i]);
-          sb.append(".class");
+          out.println("MethodBinding mb;");
+          out.println("if (isValueReference(" + propVar + "))");
+          out.indent();
+          out.println("mb = createMethodBinding(" + propVar + ", " + classArray + ");");
+          out.unindent();
+          out.println("else");
+          out.indent();
+          out.println("mb = new org.apache.myfaces.trinidadinternal.taglib.ConstantMethodBinding(" + propVar + ");");
+          out.unindent();
+        }
+        else
+        {
+          // never a literal, no need for ConstantMethodBinding
+          out.println("MethodBinding mb = createMethodBinding(" + propVar + ", " +
+                      classArray + ");");
         }
+        
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ", mb);");
+        out.unindent();
+        out.println("}");
+      }
+    }
 
-        // TODO: remove trailing comma
-        sb.append(',');
+    private void _writeSetMethodExpression(
+      PrettyWriter  out,
+      String             componentClass,
+      PropertyBean        property) throws IOException
+    {
+      String propName = property.getPropertyName();
+      String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+      String propVar = "_" + propName;
 
-        sb.append('}');
-        classArray = sb.toString();
-      }
+      out.println("bean.setProperty(" + componentClass + "." + propKey + ", " +
+                  propVar + ");");
+    }
+
+    private void _writeSetKeyStroke(
+      PrettyWriter  out,
+      String        componentClass,
+      String        propName) throws IOException
+    {
+      String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+      String propVar = "_" + propName;
 
-      out.println("if (" + propVar + " != null)");
-      out.println("{");
-      out.indent();
 
-      if (isStringMethodBindingReturnType(signature))
+      if (_is12())
       {
-        out.println("MethodBinding mb;");
-        out.println("if (isValueReference(" + propVar + "))");
+        out.println("if (" + propVar + " != null)");
+        out.println("{");
+        out.indent();
+        out.println("if (!" + propVar + ".isLiteralText())");
+        out.println("{");
         out.indent();
-        out.println("mb = createMethodBinding(" + propVar + ", " + classArray + ");");
+        out.println("bean.setValueExpression(" + componentClass + "." + propKey + ", " + propVar + ");");
         out.unindent();
+        out.println("}");
         out.println("else");
+        out.println("{");
         out.indent();
-        out.println("mb = new org.apache.myfaces.trinidadinternal.taglib.ConstantMethodBinding(" + propVar + ");");
+        out.println("Object val = " + propVar + ".getValue(null);");
+        out.println("if (val != null)");
+        out.indent();
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+        out.println("\tKeyStroke.getKeyStroke(val.toString()));");
+        out.unindent();
         out.unindent();
+        out.println("}");
+        out.unindent();
+        out.println("}");
       }
       else
       {
-        // never a literal, no need for ConstantMethodBinding
-        out.println("MethodBinding mb = createMethodBinding(" + propVar + ", " +
-                                                            classArray + ");");
+        out.println("if (" + propVar + " != null)");
+        out.println("{");
+        out.indent();
+        out.println("if (isValueReference(" + propVar + "))");
+        out.println("{");
+        out.indent();
+        out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+        out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+        out.println("\tKeyStroke.getKeyStroke(" + propVar + "));");
+        out.unindent();
+        out.println("}");
+        out.unindent();
+        out.println("}");
       }
-
-      out.println("bean.setProperty(" + componentClass + "." + propKey + ", mb);");
-      out.unindent();
-      out.println("}");
-    }
-
-    private void _writeSetKeyStroke(
-      PrettyWriter  out,
-      String        componentClass,
-      String        propName) throws IOException
-    {
-      String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
-      String propVar = "_" + propName;
-
-      out.println("if (" + propVar + " != null)");
-      out.println("{");
-      out.indent();
-      out.println("if (isValueReference(" + propVar + "))");
-      out.println("{");
-      out.indent();
-      out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
-      out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
-      out.unindent();
-      out.println("}");
-      out.println("else");
-      out.println("{");
-      out.indent();
-      out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
-      out.println("\tKeyStroke.getKeyStroke(" + propVar + "));");
-      out.unindent();
-      out.println("}");
-      out.unindent();
-      out.println("}");
     }
 
 
@@ -1864,32 +2282,69 @@
       out.println("if (" + propVar + " != null)");
       out.println("{");
       out.indent();
-      out.println("if (isValueReference(" + propVar + "))");
-      out.println("{");
-      out.indent();
-      out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
-      out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
-      out.unindent();
-      out.println("}");
-      out.println("else");
-      out.println("{");
-      out.indent();
-      out.println("try");
-      out.println("{");
-      out.indent();
-      out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
-      out.println("                 TagUtils.getColorList(" + propVar + "));");
-      out.unindent();
-      out.println("}");
-      out.println("catch (ParseException pe)");
-      out.println("{");
-      out.indent();
-      out.println("setValidationError(");
-      out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
-      out.unindent();
-      out.println("}");
-      out.unindent();
-      out.println("}");
+      if (_is12())
+      {
+        out.println("if (!" + propVar + ".isLiteralText())");
+        out.println("{");
+        out.indent();
+        out.println("bean.setValueExpression(" + componentClass + "." + propKey + ", " + propVar + ");");
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("Object o = " + propVar + ".getValue(null);");
+        out.println("if (o != null)");
+        out.indent();
+        out.println("{");
+        out.println("try");
+        out.println("{");
+        out.indent();
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+        out.println("                 TagUtils.getColorList(o.toString()));");
+        out.unindent();
+        out.println("}");
+        out.println("catch (ParseException pe)");
+        out.println("{");
+        out.indent();
+        out.println("setValidationError(");
+        out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+        out.unindent();
+        out.println("}");
+        out.unindent();
+        out.println("}");
+        out.unindent();
+        out.println("}");        
+      }
+      else
+      {
+        out.println("if (isValueReference(" + propVar + "))");
+        out.println("{");
+        out.indent();
+        out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+        out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("try");
+        out.println("{");
+        out.indent();
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+        out.println("                 TagUtils.getColorList(" + propVar + "));");
+        out.unindent();
+        out.println("}");
+        out.println("catch (ParseException pe)");
+        out.println("{");
+        out.indent();
+        out.println("setValidationError(");
+        out.println("  pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+        out.unindent();
+        out.println("}");
+        out.unindent();
+        out.println("}");
+      }
       out.unindent();
       out.println("}");
     }
@@ -1906,23 +2361,54 @@
       out.println("if (" + propVar + " != null)");
       out.println("{");
       out.indent();
-      out.println("if (isValueReference(" + propVar + "))");
-      out.println("{");
-      out.indent();
-      out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
-      out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
-      out.unindent();
-      out.println("}");
-      out.println("else");
-      out.println("{");
-      out.indent();
-      out.println("Converter converter = getFacesContext().getApplication().");
-      out.indent();
-      out.println("createConverter(" + propVar + ");");
-      out.unindent();
-      out.println("bean.setProperty(" + componentClass + "." + propKey + ", converter);");
-      out.unindent();
-      out.println("}");
+      if (_is12())
+      {
+        out.println("if (!" + propVar + ".isLiteralText())");
+        out.println("{");
+        out.indent();
+        out.println("bean.setValueExpression(" + componentClass + "." + propKey + ", " + propVar + ");");
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("Object o = " + propVar + ".getValue(null);");
+        out.println("if (o != null)");
+        out.println("{");
+
+        out.indent();
+        out.println("Converter converter = getFacesContext().getApplication().");
+        out.indent();
+        out.println("createConverter(o.toString());");
+        out.unindent();
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ", converter);");
+        
+        out.unindent();
+        out.println("}");
+        
+        out.unindent();
+        out.println("}");
+      }
+      else
+      {
+        out.println("if (isValueReference(" + propVar + "))");
+        out.println("{");
+        out.indent();
+        out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+        out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+        out.unindent();
+        out.println("}");
+        out.println("else");
+        out.println("{");
+        out.indent();
+        out.println("Converter converter = getFacesContext().getApplication().");
+        out.indent();
+        out.println("createConverter(" + propVar + ");");
+        out.unindent();
+        out.println("bean.setProperty(" + componentClass + "." + propKey + ", converter);");
+        out.unindent();
+        out.println("}");
+      }
       out.unindent();
       out.println("}");
     }
@@ -1934,6 +2420,11 @@
     return (sig != null && "java.lang.String".equals(sig.getReturnType()));
   }
 
+  private boolean _is12()
+  {
+    return "1.2".equals(jsfVersion) || "12".equals(jsfVersion);
+  }
+
   private class IfComponentModifiedFilter extends ComponentFilter
   {
     protected boolean accept(
@@ -2040,6 +2531,12 @@
    */
   private boolean force;
 
+  
+  /**
+   * @parameter
+   */
+  private String jsfVersion;
+
   static private String _resolveType(
     String className)
   {
@@ -2087,4 +2584,26 @@
     "          href     CDATA #IMPLIED\n" +
     "          xpointer CDATA #IMPLIED>\n" +
     "]>\n";
+
+  static final private Set _CAN_COERCE = new HashSet();
+  static
+  {
+    _CAN_COERCE.add("java.lang.String");
+    _CAN_COERCE.add("java.lang.Integer");
+    _CAN_COERCE.add("java.lang.Long");
+    _CAN_COERCE.add("java.lang.Boolean");
+    _CAN_COERCE.add("java.lang.Double");
+    _CAN_COERCE.add("java.lang.Float");
+    _CAN_COERCE.add("java.lang.Short");
+    _CAN_COERCE.add("java.lang.Character");
+    _CAN_COERCE.add("java.lang.Byte");
+    _CAN_COERCE.add("int");
+    _CAN_COERCE.add("long");
+    _CAN_COERCE.add("boolean");
+    _CAN_COERCE.add("double");
+    _CAN_COERCE.add("float");
+    _CAN_COERCE.add("short");
+    _CAN_COERCE.add("char");
+    _CAN_COERCE.add("byte");
+  }
 }

Modified: incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java?view=diff&rev=466171&r1=466170&r2=466171
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java (original)
+++ incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java Fri Oct 20 09:22:04 2006
@@ -179,6 +179,8 @@
     // faces-config/component/property/property-extension
     digester.addBeanPropertySetter("faces-config/component/property/property-extension/state-holder",
                                    "stateHolder");
+    digester.addBeanPropertySetter("faces-config/component/property/property-extension/jsp-property-name",
+                                   "jspPropertyName");
     // faces-config/component/property/property-extension
     digester.addBeanPropertySetter("faces-config/component/property/property-extension/list",
                                    "list");

Modified: incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java?view=diff&rev=466171&r1=466170&r2=466171
==============================================================================
--- incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java (original)
+++ incubator/adffaces/branches/faces-1_2-second/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java Fri Oct 20 09:22:04 2006
@@ -280,6 +280,18 @@
     return ("javax.faces.el.MethodBinding".equals(getPropertyClass()));
   }
 
+
+  /**
+   * Returns true if this property is a method binding.
+   *
+   * @return true  if this property is a method binding,
+   *         otherwise false
+   */
+  public boolean isMethodExpression()
+  {
+    return ("javax.el.MethodExpression".equals(getPropertyClass()));
+  }
+
   /**
    * Parses the possible values for this property into a String array
    * using space as the separator between values.
@@ -304,8 +316,32 @@
     setUnsupportedAgents(unsupportedAgents.split(" "));
   }
 
+  /**
+   * Sets the JSP name of this property.
+   *
+   * @param jspPropertyName  the JSP property name
+   */
+  public void setJspPropertyName(
+    String jspPropertyName)
+  {
+    _jspPropertyName = jspPropertyName;
+  }
+
+  /**
+   * Returns the JSP name of this property.
+   *
+   * @return  the JSP property name
+   */
+  public String getJspPropertyName()
+  {
+    if (_jspPropertyName == null)
+      return getPropertyName();
+
+    return _jspPropertyName;
+  }
 
   private String  _aliasOf;
+  private String  _jspPropertyName;
   private boolean _required;
   private boolean _literalOnly;
   private boolean _stateHolder;



Mime
View raw message