4041424344454647
{ return new Integer(clientValue.trim()); } catch (NumberFormatException ex) { throw new ValidationException(messages.format("integer-format-exception", clientValue)); } }
3132333435363738
{ return new Double(clientValue.trim()); } catch (NumberFormatException ex) { throw new ValidationException(messages.format("number-format-exception", clientValue)); } }
3637383940414243
{ return new Byte(clientValue.trim()); } catch (NumberFormatException ex) { throw new ValidationException(messages.format("integer-format-exception", clientValue)); } }
2627282930313233
String message) throws ValidationException { try { return Currency.getInstance(clientValue); } catch (final IllegalArgumentException e) { throw new ValidationException(message); } }
2829303132333435
public URL parseClient(Field field, String clientValue, String message) throws ValidationException { try { return new URL(clientValue); } catch (MalformedURLException e) { throw new ValidationException(message); } }
24252627282930
@Persist private String event; void onValidateFormFromForm() throws ValidationException { throw new ValidationException("From event handler method."); }
4647484950515253545556
// And it gets tricky because we probably should trim spaces! if (input.equalsIgnoreCase("zero")) return 0; if (input.equalsIgnoreCase("i")) throw new ValidationException("Rational numbers only, please."); // Get the default behavior. return null; }
58596061626364
void onValidateFromCount(Integer count) throws ValidationException { // count may be null if (count == null) return; if (count.equals(13)) throw new ValidationException("Thirteen is an unlucky number."); }
{ return new Float(clientValue.trim()); } catch (NumberFormatException ex) { throw new ValidationException(message); } }
3536373839404142
{ return new Long(clientValue.trim()); } catch (NumberFormatException ex) { throw new ValidationException(message); } }