Revision: 5e6b7a26200a
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Tue Jan 31 01:19:14 2012
Log: Added support for fields of type Character.
http://code.google.com/p/parancoe/source/detail?r=5e6b7a26200a
Revision: 1869a3f873a3
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Tue Jan 31 01:21:43 2012
Log: Merged
http://code.google.com/p/parancoe/source/detail?r=1869a3f873a3
==============================================================================
Revision: 5e6b7a26200a
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Tue Jan 31 01:19:14 2012
Log: Added support for fields of type Character.
http://code.google.com/p/parancoe/source/detail?r=5e6b7a26200a
Modified:
/parancoe-yaml/src/main/java/org/parancoe/yaml/ReflectionUtil.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/State.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/YamlEncoder.java
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/ReflectionUtil.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/ReflectionUtil.java Tue
Jan 31 01:19:14 2012
@@ -343,7 +343,7 @@
}
public static boolean isSimpleType(Class c) {
- return c.isPrimitive() || c == String.class || c == Integer.class |
| c == Long.class || c == Short.class
+ return c.isPrimitive() || c == String.class || c ==
Character.class || c == Integer.class || c == Long.class || c == Short.class
|| c == Double.class || c == Float.class || c ==
Boolean.class || c == BigInteger.class
|| c == BigDecimal.class || c == Date.class || c.isEnum() |
| c == File.class;
}
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/State.java Tue Jan 3
06:27:22 2012
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/State.java Tue Jan 31
01:19:14 2012
@@ -172,6 +172,8 @@
static Object convertType(Object value, Class type) {
if ("~".equals(value))
return null;
+ else if (type == Character.class || type == Character.TYPE)
+ return Character.valueOf(value.toString().charAt(0));
else if (type == Integer.class || type == Integer.TYPE)
return new Integer(value.toString());
else if (type == String.class) {
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlEncoder.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlEncoder.java Tue Jan
31 01:19:14 2012
@@ -320,7 +320,7 @@
}
void writeSimpleValue(Object value, Class expectedType, String indent)
{
- if (value instanceof String)
+ if (value instanceof String || value instanceof Character)
out.println(stringify(value, indent));
else {
if ((expectedType == null || !isMinimalOutput())
==============================================================================
Revision: 1869a3f873a3
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Tue Jan 31 01:21:43 2012
Log: Merged
http://code.google.com/p/parancoe/source/detail?r=1869a3f873a3