if (null != comparator)
{
if (false == validateOperatorOnComparisonResult(operator, comparator.compare(value, foreignValue)))
{
throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message, args));
}
}
else if ( (value instanceof Comparable) && (foreignValue instanceof Comparable) )
{
try
{
if (false == validateOperatorOnComparisonResult(operator, ((Comparable)value).compareTo(foreignValue)))
{
throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message, args));
}
}
catch (RuntimeException exception)
{
if (exception instanceof ValidatorException)
{
throw exception;
}
else
{
throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, message + ": " + exception.getLocalizedMessage(), args));
}
}
}
else if (value instanceof Comparable)
{