Exemple #1
0
  /** {@inheritDoc} */
  @Override
  @SuppressWarnings("unchecked")
  public Object convertFromString(Map ctx, String[] value, Class arg2) {
    if (value[0] == null || value[0].trim().equals("")) {
      return null;
    }

    try {
      return DateUtil.convertStringToDate(value[0]);
    } catch (ParseException pe) {
      throw new TypeConversionException(pe.getMessage(), pe);
    }
  }
Exemple #2
0
 /** {@inheritDoc} */
 @Override
 @SuppressWarnings("unchecked")
 public String convertToString(Map ctx, Object data) {
   return DateUtil.convertDateToString((Date) data);
 }