public FormResult validate(HttpServletRequest request, FormInputValues params) {
log.trace("validate()");
FormResultImpl result = new FormResultImpl(this);
if (this.inputs != null) {
VariableResolver resolver = new CalyxoVariableResolver(request);
Iterator inputs = getFormInputs();
while (inputs.hasNext()) {
FormInput input = (FormInput)inputs.next();
if (input.isIgnored(resolver)) {
result.add(new IgnoredFormInputResult(input, params));
} else {
result.add(input.validate(request, params, resolver));
}
}
}
if (asserts != null) {
AssertVariableResolver resolver =
new AssertVariableResolver(request, params, result);
Iterator asserts = this.asserts.iterator();
while (asserts.hasNext()) {
Assert azzert = (Assert)asserts.next();
resolver.reset();
boolean asserted = azzert.eval(resolver);
if (!asserted && !resolver.isInvalidPropertyReferenced()) {
result.assertionFailed(resolver, azzert.getMessage());
}
}
}