{
InputComponent<?, ?> currentInputComponent = context.getCurrentInputComponent();
Object value = InputComponents.getValueFor(currentInputComponent);
if (value != null)
{
ValidationResult result = validate(value.toString());
switch (result.getType())
{
case ERROR:
context.addValidationError(currentInputComponent, result.getMessage());
break;
case WARNING:
context.addValidationWarning(currentInputComponent, result.getMessage());
break;
default:
break;
}
}