TRINIDAD-2405 Allow numberConverter to specify roundingmode 
This checkin is to the trinidad-maven/trunk branch
Thanks to Yee-Wah Lee for the patch
diff --git a/maven-faces-plugin/pom.xml b/maven-faces-plugin/pom.xml
index b56883e..403b5ba 100644
--- a/maven-faces-plugin/pom.xml
+++ b/maven-faces-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId> 
-    <version>2.0.8-SNAPSHOT</version>
+    <version>2.0.9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
index 7b3825a..748c7cd 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
@@ -19,19 +19,21 @@
 package org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
 
 import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.ClassLoaderUtils;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
 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.generator.GeneratorHelper;
 import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugin.MojoExecutionException;
 
 import java.io.File;
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.Map;
-import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.Collections;
 
 public abstract class AbstractTagGenerator {
@@ -234,7 +236,29 @@
 
   protected String resolveType(String className)
   {
-    return (String)_RESOLVABLE_TYPES.get(className);
+    String type = (String)_RESOLVABLE_TYPES.get(className);
+    
+    if (type != null)
+      return (String)_RESOLVABLE_TYPES.get(className);
+    
+    try 
+    {
+      // Enums may be set using String, add those as discovered.
+      if (ClassLoaderUtils.loadClass (className).isEnum())
+      {
+        _RESOLVABLE_TYPES .put (className, "Enum");
+        return "Enum";
+      }          
+    }
+    catch (LinkageError le)    
+    {
+      getLog().info("Linkage error resolving type " + className, le);
+    }
+    catch (ClassNotFoundException ce)
+    {
+      getLog().info ("ClassNotFound error resolving type " + className, ce);
+    }
+   return null; 
   }
 
   // TODO: for everything but Locale, String[], Date, and TimeZone,
@@ -242,7 +266,7 @@
   // not need any of the "TagUtils" functions
   private Map<String, String> _createResolvableTypes()
   {
-    Map<String, String> resolvableTypes = new HashMap<String, String>();
+    Map<String, String> resolvableTypes = new ConcurrentHashMap<String, String>();
 
     resolvableTypes.put("boolean", "Boolean");
     resolvableTypes.put("char", "Character");
@@ -256,9 +280,8 @@
     resolvableTypes.put("java.lang.String[]", "StringArray");
     resolvableTypes.put("java.util.TimeZone", "TimeZone");
 
-    return Collections.unmodifiableMap(resolvableTypes);
+    return (resolvableTypes);
   }
 
-  final private Map _RESOLVABLE_TYPES = _createResolvableTypes();
-
+  private Map _RESOLVABLE_TYPES = _createResolvableTypes();
 }
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
index c6fdbe1..1c6a96a 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
@@ -114,13 +114,21 @@
         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));");
+        if ("Enum".equals (propType))
+        {
+          out.println(propClass + " value = Enum.valueOf(" + propClass + ".class, " + propVar + ".getExpressionString());");
+        }
+        else 
+        {
+          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))
@@ -158,7 +166,15 @@
           out.println("try");
           out.println("{");
         }
-        out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+        
+        if ("Enum".equals (propType))
+        {
+          out.println(propClass + " value = Enum.valueOf(" + propClass + ".class, " + propVar + ");");
+        }
+        else
+        {
+          out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+        }
         String setMethod = Util.getPrefixedPropertyName("set", propName);
         out.println("converter." + setMethod + "(value);");
         if ("StringArray".equals(propType))
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/ClassLoaderUtils.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/ClassLoaderUtils.java
new file mode 100644
index 0000000..17be859
--- /dev/null
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/util/ClassLoaderUtils.java
@@ -0,0 +1,101 @@
+/*

+ * Licensed to the Apache Software Foundation (ASF) under one

+ * or more contributor license agreements.  See the NOTICE file

+ * distributed with this work for additional information

+ * regarding copyright ownership.  The ASF licenses this file

+ * to you under the Apache License, Version 2.0 (the

+ * "License"); you may not use this file except in compliance

+ * with the License.  You may obtain a copy of the License at

+ *

+ *   http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing,

+ * software distributed under the License is distributed on an

+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ * KIND, either express or implied.  See the License for the

+ * specific language governing permissions and limitations

+ * under the License.

+ */

+package org.apache.myfaces.trinidadbuild.plugin.faces.util;

+

+

+/**

+ * Utility methods for accessing classes and resources using an appropriate

+ * class loader.

+ *

+ */

+public final class ClassLoaderUtils

+{

+  // Utility class only, no instances

+  private ClassLoaderUtils()

+  {

+  }

+  

+  /**

+   * Loads the class with the specified name.  For Java 2 callers, the

+   * current thread's context class loader is preferred, falling back on the

+   * system class loader of the caller when the current thread's context is not

+   * set, or the caller is pre Java 2.

+   *

+   * @param     name  the name of the class

+   * @return    the resulting <code>Class</code> object

+   * @exception ClassNotFoundException if the class was not found

+   */

+  public static Class<?> loadClass(

+    String name) throws ClassNotFoundException

+  {

+    return loadClass(name, null);

+  }

+

+  /**

+   * Loads the class with the specified name.  For Java 2 callers, the

+   * current thread's context class loader is preferred, falling back on the

+   * class loader of the caller when the current thread's context is not set,

+   * or the caller is pre Java 2.  If the callerClassLoader is null, then

+   * fall back on the system class loader.

+   *

+   * @param     name  the name of the class

+   * @param     callerClassLoader  the calling class loader context

+   * @return    the resulting <code>Class</code> object

+   * @exception ClassNotFoundException if the class was not found

+   */

+  public static Class<?> loadClass(

+    String      name,

+    ClassLoader callerClassLoader) throws ClassNotFoundException

+  {

+    Class<?> clazz = null;

+

+    try

+    {

+      ClassLoader loader = getContextClassLoader();

+

+      if (loader != null)

+        clazz = loader.loadClass(name);

+    }

+    catch (ClassNotFoundException e)

+    {

+      // treat as though loader not set

+      ;

+    }

+

+    if (clazz == null)

+    {

+      if (callerClassLoader != null)

+        clazz = callerClassLoader.loadClass(name);

+      else

+        clazz = Class.forName(name);

+    }

+

+    return clazz;

+  }

+  

+  /**

+   * Dynamically accesses the current context class loader.

+   * Returns null if there is no per-thread context class loader.

+   */

+  public static ClassLoader getContextClassLoader()

+  {

+    return Thread.currentThread().getContextClassLoader();

+  }

+

+}

diff --git a/maven-i18n-plugin/pom.xml b/maven-i18n-plugin/pom.xml
index 00c360c..679065e 100644
--- a/maven-i18n-plugin/pom.xml
+++ b/maven-i18n-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId>
-    <version>2.0.8-SNAPSHOT</version>
+    <version>2.0.9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-javacc-plugin/pom.xml b/maven-javacc-plugin/pom.xml
index 0bcc064..7dccc8b 100644
--- a/maven-javacc-plugin/pom.xml
+++ b/maven-javacc-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId>
-    <version>2.0.8-SNAPSHOT</version>
+    <version>2.0.9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-javascript-plugin/pom.xml b/maven-javascript-plugin/pom.xml
index f1ef97c..9646621 100644
--- a/maven-javascript-plugin/pom.xml
+++ b/maven-javascript-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId>
-    <version>2.0.8-SNAPSHOT</version>
+    <version>2.0.9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-jdev-plugin/pom.xml b/maven-jdev-plugin/pom.xml
index 200a883..e7d7f9e 100644
--- a/maven-jdev-plugin/pom.xml
+++ b/maven-jdev-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId>
-    <version>2.0.8-SNAPSHOT</version>
+    <version>2.0.9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-tagdoc-plugin/pom.xml b/maven-tagdoc-plugin/pom.xml
index 1be77d1..667e901 100644
--- a/maven-tagdoc-plugin/pom.xml
+++ b/maven-tagdoc-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId>
-    <version>2.0.8-SNAPSHOT</version>
+    <version>2.0.9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-xrts-plugin/pom.xml b/maven-xrts-plugin/pom.xml
index fbe2d75..d20a957 100644
--- a/maven-xrts-plugin/pom.xml
+++ b/maven-xrts-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidadbuild</groupId>
     <artifactId>maven-plugin-parent</artifactId>
-    <version>2.0.8-SNAPSHOT</version>
+    <version>2.0.9-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/pom.xml b/pom.xml
index 8166b3d..6c12034 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
 
   <groupId>org.apache.myfaces.trinidadbuild</groupId>
   <artifactId>maven-plugin-parent</artifactId>
-  <version>2.0.8-SNAPSHOT</version>
+  <version>2.0.9-SNAPSHOT</version>
   <packaging>pom</packaging>
   <name>Apache Trinidad Maven Plugin Parent</name>