[jboss-cvs] jboss-seam/src/main/org/jboss/seam/util ...
Norman Richards
norman.richards at jboss.com
Tue Dec 19 11:23:38 EST 2006
User: nrichards
Date: 06/12/19 11:23:38
Modified: src/main/org/jboss/seam/util Conversions.java
Log:
allow bigdecimal input in components.xml
Revision Changes Path
1.9 +22 -2 jboss-seam/src/main/org/jboss/seam/util/Conversions.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Conversions.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/util/Conversions.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- Conversions.java 21 Nov 2006 05:17:13 -0000 1.8
+++ Conversions.java 19 Dec 2006 16:23:38 -0000 1.9
@@ -11,6 +11,9 @@
import java.util.Properties;
import java.util.Set;
+import java.math.BigInteger;
+import java.math.BigDecimal;
+
public class Conversions
{
@@ -36,8 +39,8 @@
//put(Date.class, new DateTimeConverter());
//put(Short.class, new ShortConverter());
//put(Byte.class, new ByteConverter());
- //put(BigInteger.class, new BigIntegerConverter());
- //put(BigDecimal.class, new BigDecimalConverter());
+ put(BigInteger.class, new BigIntegerConverter());
+ put(BigDecimal.class, new BigDecimalConverter());
put(Class.class, new ClassConverter());
}};
@@ -117,6 +120,23 @@
}
}
+ public static class BigDecimalConverter implements Converter<BigDecimal>
+ {
+ public BigDecimal toObject(PropertyValue value, Type type)
+ {
+ return new BigDecimal(value.getSingleValue());
+ }
+ }
+
+ public static class BigIntegerConverter implements Converter<BigInteger>
+ {
+ public BigInteger toObject(PropertyValue value, Type type)
+ {
+ return new BigInteger(value.getSingleValue());
+ }
+ }
+
+
public static class StringArrayConverter implements Converter<String[]>
{
public String[] toObject(PropertyValue values, Type type)
More information about the jboss-cvs-commits
mailing list