6465666768697071
protected Date convert(String text) { if (text == null || text.isEmpty()) return null; try { return new SimpleDateFormat(dateFormat).parse(text); } catch (ParseException e) { throw new ConvertException(e, dateFormat); } }
9091929394959697
* @see org.pirkaengine.form.field.BaseField#convert(java.lang.String) */ @Override protected String convert(String text) { if (text == null || text.isEmpty()) return null; if (!options.isEmpty() && !options.contains(text)) throw new ConvertException(options.toString()); return text; }
4445464748495051
protected Integer convert(String text) { if (text == null || text.isEmpty()) return null; try { return Integer.parseInt(text); } catch (NumberFormatException e) { throw new ConvertException(e); } }
protected Float convert(String text) throws ConvertException { if (text == null || text.isEmpty()) return null; try { return Float.parseFloat(text); } catch (NumberFormatException e) { throw new ConvertException(e); } }
6061626364656667
protected T convert(String text) { if (text == null || text.isEmpty()) return null; try { return Enum.valueOf(enumClass, text); } catch (IllegalArgumentException e) { throw new ConvertException(e); } }