@SuppressWarnings("unchecked")
T t = (T) (value == null ? null : getDateFormat().parse(
(String) value));
return t;
} catch (ParseException exception) {
throw new IsoConversionException(String.valueOf(value),
exception);
}
} else {
if (type == String.class) {
try {
@SuppressWarnings("unchecked")
T t = (T) (value == null ? null : getDateFormat().format(
(Date) value));
return t;
} catch (ClassCastException exception) {
throw new IsoConversionException(String.valueOf(value),
exception);
}
}
}
throw new IsoConversionNotSupportedException(type.getName());