@param iso8601DateAsString The date parameter as a String. @return The corresponding Date object representing the result of parsing the date parameter. @throws InvalidDateException In case of an invalid date.
(String iso8601DateAsString)
| 314 | * @throws InvalidDateException In case of an invalid date. |
| 315 | */ |
| 316 | public Date parse(String iso8601DateAsString) throws |
| 317 | InvalidDateException |
| 318 | { |
| 319 | Calendar calendar = getCalendar(iso8601DateAsString); |
| 320 | try |
| 321 | { |
| 322 | calendar.setLenient(false); |
| 323 | return calendar.getTime(); |
| 324 | } |
| 325 | catch (Exception e) |
| 326 | { |
| 327 | throw new InvalidDateException(iso8601DateAsString + " " + e.getClass().toString() + " " + e.getMessage()); |
| 328 | } |
| 329 | } |
| 330 | } |