}\r
\r
public static Object parsePrimitive(TCon expectedType, String value) {\r
- try {\r
- if (expectedType == Types.DOUBLE) {\r
- return Double.parseDouble(value);\r
- }\r
- else if (expectedType == Types.INTEGER) {\r
- return Integer.parseInt(value);\r
- }\r
- else if (expectedType == Types.FLOAT) {\r
- return Float.parseFloat(value);\r
- }\r
- else if (expectedType == Types.BYTE) {\r
- return Byte.parseByte(value);\r
- }\r
- else if (expectedType == Types.SHORT) {\r
- return Short.parseShort(value);\r
- }\r
- else if (expectedType == Types.LONG) {\r
- return Long.parseLong(value);\r
- }\r
- else if (expectedType == Types.BOOLEAN) {\r
- return Boolean.parseBoolean(value);\r
- }\r
- else if (expectedType == Types.CHARACTER && value.length() == 1) {\r
- return value.charAt(0);\r
- }\r
- } catch(NumberFormatException e) {\r
- e.printStackTrace();\r
+ if (expectedType == Types.DOUBLE) {\r
+ return Double.parseDouble(value);\r
+ }\r
+ else if (expectedType == Types.INTEGER) {\r
+ return Integer.parseInt(value);\r
+ }\r
+ else if (expectedType == Types.FLOAT) {\r
+ return Float.parseFloat(value);\r
+ }\r
+ else if (expectedType == Types.BYTE) {\r
+ return Byte.parseByte(value);\r
+ }\r
+ else if (expectedType == Types.SHORT) {\r
+ return Short.parseShort(value);\r
+ }\r
+ else if (expectedType == Types.LONG) {\r
+ return Long.parseLong(value);\r
+ }\r
+ else if (expectedType == Types.BOOLEAN) {\r
+ return Boolean.parseBoolean(value);\r
+ }\r
+ else if (expectedType == Types.CHARACTER && value.length() == 1) {\r
+ return value.charAt(0);\r
}\r
\r
return value;\r