public Object toObject(String string, Class<?> targetClass) { if (!StringUtils.hasText(string)) { return null; } DateFormat dateFormat = getDateFormat(); try { return dateFormat.parse(string); } catch (ParseException e) { throw new InvalidFormatException(string, getPattern(dateFormat), e); } }
public Object toObject(String string, Class<?> targetClass) { if (!StringUtils.hasText(string)) { return null; } DateFormat dateFormat = getDateFormat(); try { return dateFormat.parse(string); } catch (ParseException e) { throw new InvalidFormatException(string, getPattern(dateFormat), e); } }
public Object toObject(String string, Class targetClass) throws Exception { if (!StringUtils.hasText(string)) { return null; } DateFormat dateFormat = getDateFormat(); try { return dateFormat.parse(string); } catch (ParseException e) { throw new InvalidFormatException(string, getPattern(dateFormat), e); } }