equal
deleted
inserted
replaced
340 public static Object createObjectFromString(String type, String value) |
340 public static Object createObjectFromString(String type, String value) |
341 throws Exception { |
341 throws Exception { |
342 Object result; |
342 Object result; |
343 if (primitiveToWrapper.containsKey(type)) { |
343 if (primitiveToWrapper.containsKey(type)) { |
344 if (type.equals(Character.TYPE.getName())) { |
344 if (type.equals(Character.TYPE.getName())) { |
345 result = new Character(value.charAt(0)); |
345 result = value.charAt(0); |
346 } else { |
346 } else { |
347 result = newStringConstructor( |
347 result = newStringConstructor( |
348 ((Class<?>) primitiveToWrapper.get(type)).getName(), |
348 ((Class<?>) primitiveToWrapper.get(type)).getName(), |
349 value); |
349 value); |
350 } |
350 } |
351 } else if (type.equals(Character.class.getName())) { |
351 } else if (type.equals(Character.class.getName())) { |
352 result = new Character(value.charAt(0)); |
352 result = value.charAt(0); |
353 } else if (Number.class.isAssignableFrom(Utils.getClass(type))) { |
353 } else if (Number.class.isAssignableFrom(Utils.getClass(type))) { |
354 result = createNumberFromStringValue(value); |
354 result = createNumberFromStringValue(value); |
355 } else if (value == null || value.equals("null")) { |
355 } else if (value == null || value.equals("null")) { |
356 // hack for null value |
356 // hack for null value |
357 result = null; |
357 result = null; |