incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bara...@apache.org
Subject svn commit: r497955 - in /incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces: generator/taglib/MyFacesComponentTagGenerator.java util/Util.java
Date Fri, 19 Jan 2007 21:07:11 GMT
Author: baranda
Date: Fri Jan 19 13:07:10 2007
New Revision: 497955

URL: http://svn.apache.org/viewvc?view=rev&rev=497955
Log:
When the property is a literalOnly, in the setProperties method write the correct setter call
for the myfaces generator

Modified:
    incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
    incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/Util.java

Modified: incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java?view=diff&rev=497955&r1=497954&r2=497955
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
(original)
+++ incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
Fri Jan 19 13:07:10 2007
@@ -239,6 +239,10 @@
     {
       _writeSetConverter(out, componentClass, propName);
     }
+    else if (property.isLiteralOnly())
+    {
+      _writeSetPropertyLiteralOnly(out, property);
+    }
     else
     {
       _writeSetProperty(out, propName, propVar);
@@ -262,6 +266,25 @@
     {
       _writeSetValueBinding(out, propName, propVar);
     }
+    out.unindent();
+    out.println("}");
+  }
+
+  private void _writeSetPropertyLiteralOnly(
+      PrettyWriter out,
+      PropertyBean property)
+  {
+    String propName = property.getPropertyName();
+    String propVar = "_" + propName;
+    String jspPropName = property.getJspPropertyName();
+    String setMethod = Util.getPrefixedPropertyName("set", jspPropName);
+    
+    out.println("if (" + propVar + " != null) ");
+    out.println("{");
+    out.indent();
+
+    out.println("comp."+setMethod+"("+ propVar + ");");
+
     out.unindent();
     out.println("}");
   }

Modified: incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/Util.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/Util.java?view=diff&rev=497955&r1=497954&r2=497955
==============================================================================
--- incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/Util.java
(original)
+++ incubator/adffaces/branches/faces-1_2-061113/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/Util.java
Fri Jan 19 13:07:10 2007
@@ -316,11 +316,7 @@
         if (isPrimitiveClass(propertyFullClass)){
             return def;
         } else if ("java.lang.String".equals(propertyFullClass)){
-            if (def.startsWith("\"") && def.endsWith("\"")){
-                return def;
-            } else {
-                return "\""+def+"\"";
-            }
+           return Util.convertStringToLiteral(def);
         }
         return null;
     }



Mime
View raw message