use of io.vertigo.vega.webservice.validation.UiMessageStack in project vertigo by KleeGroup.
the class ValidatorWebServiceHandlerPlugin method handle.
/**
* {@inheritDoc}
*/
@Override
public Object handle(final Request request, final Response response, final WebServiceCallContext routeContext, final HandlerChain chain) throws SessionException {
final WebServiceDefinition webServiceDefinition = routeContext.getWebServiceDefinition();
final UiMessageStack uiMessageStack = routeContext.getUiMessageStack();
for (final WebServiceParam webServiceParam : webServiceDefinition.getWebServiceParams()) {
final Object value = routeContext.getParamValue(webServiceParam);
validateParam(value, uiMessageStack, webServiceParam, routeContext);
}
if (uiMessageStack.hasErrors()) {
throw new ValidationUserException();
}
return chain.handle(request, response, routeContext);
}
Aggregations