return (ValidationError)result;
else if (result instanceof CannotYetResolveWarning)
return null;
int length = ((BigDecimal)result).intValue();
if (string.length() != length)
return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.string.exact-length", new String[] {String.valueOf(length)}, Constants.I18N_CATALOGUE));
return null;
} else if (minExpr != null && maxExpr != null) {
Object result = evaluateNumeric(minExpr, expressionContext, "min", "length");
if (result instanceof ValidationError)
return (ValidationError)result;
else if (result instanceof CannotYetResolveWarning)
return null;
int minLength = ((BigDecimal)result).intValue();
result = evaluateNumeric(maxExpr, expressionContext, "max", "length");
if (result instanceof ValidationError)
return (ValidationError)result;
else if (result instanceof CannotYetResolveWarning)
return null;
int maxLength = ((BigDecimal)result).intValue();
if (string.length() < minLength || string.length() > maxLength)
return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.string.range-length", new String[] {String.valueOf(minLength), String.valueOf(maxLength)}, Constants.I18N_CATALOGUE));
return null;
} else if (minExpr != null) {
Object result = evaluateNumeric(minExpr, expressionContext, "min", "length");
if (result instanceof ValidationError)
return (ValidationError)result;
else if (result instanceof CannotYetResolveWarning)
return null;
int length = ((BigDecimal)result).intValue();
if (string.length() < length)
return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.string.min-length", new String[] {String.valueOf(length)}, Constants.I18N_CATALOGUE));
return null;
} else if (maxExpr != null) {
Object result = evaluateNumeric(maxExpr, expressionContext, "max", "length");
if (result instanceof ValidationError)
return (ValidationError)result;
else if (result instanceof CannotYetResolveWarning)
return null;
int length = ((BigDecimal)result).intValue();
if (string.length() > length)
return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.string.max-length", new String[] {String.valueOf(length)}, Constants.I18N_CATALOGUE));
return null;
}
return null;
}