myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r991847 - /myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/
Date Thu, 02 Sep 2010 08:11:41 GMT
Author: matzew
Date: Thu Sep  2 08:11:40 2010
New Revision: 991847

URL: http://svn.apache.org/viewvc?rev=991847&view=rev
Log:
TRINIDAD-1898

reflecting new Converter/Validaotr EL Tags in code generator

did some more generics 'work'

Modified:
    myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java
    myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
    myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java
    myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java
    myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
    myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java

Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java?rev=991847&r1=991846&r2=991847&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java
(original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java
Thu Sep  2 08:11:40 2010
@@ -48,7 +48,7 @@ public abstract class AbstractConverterT
       StringWriter sw = new StringWriter();
       PrettyWriter out = new PrettyWriter(sw);
 
-      Set imports = createImports(converter);
+      Set<String> imports = createImports(converter);
       writeHeader(out, converter, imports);
 
       writeClass(out, converter);
@@ -79,7 +79,7 @@ public abstract class AbstractConverterT
     }
   }
 
-  protected abstract Set createImports(ConverterBean converter);
+  protected abstract Set<String> createImports(ConverterBean converter);
   protected abstract void writeSetProperty(PrettyWriter out, PropertyBean property);
 
 
@@ -174,7 +174,8 @@ public abstract class AbstractConverterT
     }
 
 
-  private void writeClass(PrettyWriter out, AbstractTagBean abstractTag) {
+  protected void writeClass(PrettyWriter out, AbstractTagBean abstractTag)
+  {
     String className = Util.getClassFromFullClass(abstractTag.getTagClass());
     if (is12())
     {

Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java?rev=991847&r1=991846&r2=991847&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
(original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
Thu Sep  2 08:11:40 2010
@@ -181,7 +181,7 @@ public abstract class AbstractTagGenerat
 
   protected void writeImports(
     PrettyWriter   out,
-    AbstractTagBean  abstractTagBean, Set imports)
+    AbstractTagBean  abstractTagBean, Set<String> imports)
   {
 
     // do not import implicit!
@@ -191,7 +191,7 @@ public abstract class AbstractTagGenerat
     GeneratorHelper.writeImports(out, packageName, imports);
   }
 
-  protected final void writeHeader(PrettyWriter out, AbstractTagBean converter, Set imports)
{
+  protected final void writeHeader(PrettyWriter out, AbstractTagBean converter, Set<String>
imports) {
     String packageName = Util.getPackageFromFullClass(converter.getTagClass());
     // header/copyright
     writePreamble(out);
@@ -209,7 +209,7 @@ public abstract class AbstractTagGenerat
     out.println(" */");
   }
 
-  protected void addImportsFromPropertes(AbstractTagBean abstractTagBean, Set imports) {
+  protected void addImportsFromPropertes(AbstractTagBean abstractTagBean, Set<String>
imports) {
     Iterator<PropertyBean> properties = abstractTagBean.properties();
     properties = new FilteredIterator(properties, new TagAttributeFilter());
 
@@ -242,9 +242,9 @@ public abstract class AbstractTagGenerat
   // TODO: for everything but Locale, String[], Date, and TimeZone,
   // in JSF 1.2 we should already be going through coercion, and
   // not need any of the "TagUtils" functions
-  private Map _createResolvableTypes()
+  private Map<String, String> _createResolvableTypes()
   {
-    Map resolvableTypes = new HashMap();
+    Map<String, String> resolvableTypes = new HashMap<String, String>();
 
     resolvableTypes.put("boolean", "Boolean");
     resolvableTypes.put("char", "Character");

Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java?rev=991847&r1=991846&r2=991847&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java
(original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java
Thu Sep  2 08:11:40 2010
@@ -49,7 +49,7 @@ public abstract class AbstractValidatorT
 
       StringWriter sw = new StringWriter();
       PrettyWriter out = new PrettyWriter(sw);
-      Set imports = createImports(validator);
+      Set<String> imports = createImports(validator);
       writeHeader(out, validator, imports);
 
       writeClass(out, validator);
@@ -81,9 +81,10 @@ public abstract class AbstractValidatorT
     }
   }
 
-  protected abstract Set createImports(ValidatorBean validator);
+  protected abstract Set<String> createImports(ValidatorBean validator);
 
-  protected void writeClass(PrettyWriter out, AbstractTagBean abstractTag) {
+  protected void writeClass(PrettyWriter out, AbstractTagBean abstractTag)
+  {
     String className = Util.getClassFromFullClass(abstractTag.getTagClass());
     if (is12())
     {

Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java?rev=991847&r1=991846&r2=991847&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java
(original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java
Thu Sep  2 08:11:40 2010
@@ -33,8 +33,8 @@ public class MyFacesConverterTagGenerato
     super(is12, licenseHeader, log);
   }
 
-  protected Set createImports(ConverterBean converter) {
-    Set imports = new TreeSet();
+  protected Set<String> createImports(ConverterBean converter) {
+    Set<String> imports = new TreeSet<String>();
 
     if (is12())
     {

Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java?rev=991847&r1=991846&r2=991847&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
(original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
Thu Sep  2 08:11:40 2010
@@ -20,6 +20,7 @@ package org.apache.myfaces.trinidadbuild
 
 import org.apache.maven.plugin.logging.Log;
 import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
 import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ConverterBean;
 import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
@@ -38,7 +39,7 @@ public class TrinidadConverterTagGenerat
 
     if (is12())
     {
-      imports.add("javax.faces.webapp.ConverterELTag");
+      imports.add("org.apache.myfaces.trinidad.webapp.TrinidadConverterELTag");
       imports.add("javax.faces.context.FacesContext");
       imports.add("javax.faces.application.Application");
     }
@@ -66,7 +67,23 @@ public class TrinidadConverterTagGenerat
     return imports;
   }
 
-
+  @Override
+  protected void writeClass(PrettyWriter out, AbstractTagBean abstractTag)
+  {
+    String className = Util.getClassFromFullClass(abstractTag.getTagClass());
+    if (is12())
+    {
+      out.println("public class " + className +
+                  " extends TrinidadConverterELTag");
+      out.println("{");
+      out.indent();
+    }
+    else
+    {
+      // non 1.2
+      super.writeClass(out, abstractTag);
+    }
+  }
 
 
   protected void writeSetProperty(

Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java?rev=991847&r1=991846&r2=991847&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java
(original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java
Thu Sep  2 08:11:40 2010
@@ -20,6 +20,7 @@ package org.apache.myfaces.trinidadbuild
 
 import org.apache.maven.plugin.logging.Log;
 import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
 import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
 import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
@@ -38,7 +39,7 @@ public class TrinidadValidatorTagGenerat
 
     if (is12())
     {
-      imports.add("javax.faces.webapp.ValidatorELTag");
+      imports.add("org.apache.myfaces.trinidad.webapp.TrinidadValidatorELTag");
       imports.add("javax.faces.context.FacesContext");
       imports.add("javax.faces.application.Application");
     }
@@ -65,6 +66,24 @@ public class TrinidadValidatorTagGenerat
     addImportsFromPropertes(validator, imports);
     return imports;
   }
+  
+  @Override
+  protected void writeClass(PrettyWriter out, AbstractTagBean abstractTag)
+  {
+    String className = Util.getClassFromFullClass(abstractTag.getTagClass());
+    if (is12())
+    {
+      out.println("public class " + className +
+                  " extends TrinidadValidatorELTag");
+      out.println("{");
+      out.indent();
+    }
+    else
+    {
+      // non 1.2
+      super.writeClass(out, abstractTag);
+    }
+  }
 
   protected void writeSetProperty(
     PrettyWriter out,



Mime
View raw message