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