Exemplo n.º 1
0
 /**
  * Convert Date into a date string in xml format.
  *
  * @param val date in string form
  * @param comp associated component
  * @param ctx bind context for associate Binding and extra parameter (e.g. format)
  * @return the converted Date
  */
 public String coerceToBean(Date val, Component comp, BindContext ctx) {
   String result = DateUtil.formatDateToXML(val);
   return result;
 }
Exemplo n.º 2
0
 /**
  * Convert String to Date.
  *
  * @param val date in xml format to be converted
  * @param comp associated component
  * @param ctx bind context for associate Binding and extra parameter (e.g. format)
  * @return the converted String
  */
 public Date coerceToUi(String val, Component comp, BindContext ctx) {
   final Date xmlDateTime = DateUtil.parseXMLDateTime(val);
   return xmlDateTime;
 }