protected ResponseHtmlBeanValidator createHtmlBeanValidator(HtmlResponse response, ResponseReflectingOption option) { return new ResponseHtmlBeanValidator(requestManager, runtime, option.isHtmlBeanValidationErrorWarned(), response); }
protected ResponseJsonBeanValidator createJsonBeanValidator(JsonResponse<?> response, ResponseReflectingOption option) { return new ResponseJsonBeanValidator(requestManager, runtime, option.isJsonBeanValidationErrorWarned(), response); }
protected void validateJsonBeanIfNeeds(Object jsonBean, JsonResponse<?> response) { if (response.isValidatorSuppressed()) { // by individual requirement logger.debug("...Suppressing JSON bean validator by response option: {}", response); return; } final ResponseReflectingOption option = adjustResponseReflecting(); if (option.isJsonBeanValidatorSuppressed()) { // by project policy return; } // cannot-be-validatable skip is embedded in the response validator doValidateJsonBean(jsonBean, response, option); }
protected DisplayDataValidator createDisplayDataValidator(HtmlResponse response) { if (response.isValidatorSuppressed()) { // by individual requirement logger.debug("...Suppressing HTML bean validator by response option: {}", response); return (key, value) -> {}; } final ResponseReflectingOption option = adjustResponseReflecting(); if (option.isHtmlBeanValidatorSuppressed()) { // by project policy return (key, value) -> {}; } final ResponseHtmlBeanValidator validator = createHtmlBeanValidator(response, option); return (key, value) -> { // registered data cannot be null validator.validate(key, value); // cannot-be-validatable skip is embedded in the response validator }; }
final String json; if (response.isReturnAsEmptyBody()) { // asEmptyBody() if (adjustResponseReflecting().isJsonEmptyBodyTreatedAsEmptyObject()) { // for e.g. client fitting json = "{}"; // is empty object } else { // basically here if empty body
protected DisplayDataValidator createDisplayDataValidator(HtmlResponse response) { if (response.isValidatorSuppressed()) { // by individual requirement logger.debug("...Suppressing HTML bean validator by response option: {}", response); return (key, value) -> {}; } final ResponseReflectingOption option = adjustResponseReflecting(); if (option.isHtmlBeanValidatorSuppressed()) { // by project policy return (key, value) -> {}; } final ResponseHtmlBeanValidator validator = createHtmlBeanValidator(response, option); return (key, value) -> { // registered data cannot be null validator.validate(key, value); // cannot-be-validatable skip is embedded in the response validator }; }
final String json; if (response.isReturnAsEmptyBody()) { // asEmptyBody() if (adjustResponseReflecting().isJsonEmptyBodyTreatedAsEmptyObject()) { // for e.g. client fitting json = "{}"; // is empty object } else { // basically here if empty body
protected void validateJsonBeanIfNeeds(Object jsonBean, JsonResponse<?> response) { if (response.isValidatorSuppressed()) { // by individual requirement logger.debug("...Suppressing JSON bean validator by response option: {}", response); return; } final ResponseReflectingOption option = adjustResponseReflecting(); if (option.isJsonBeanValidatorSuppressed()) { // by project policy return; } // cannot-be-validatable skip is embedded in the response validator doValidateJsonBean(jsonBean, response, option); }
protected ResponseJsonBeanValidator createJsonBeanValidator(JsonResponse<?> response, ResponseReflectingOption option) { return new ResponseJsonBeanValidator(requestManager, runtime, option.isJsonBeanValidationErrorWarned(), response); }
protected ResponseHtmlBeanValidator createHtmlBeanValidator(HtmlResponse response, ResponseReflectingOption option) { return new ResponseHtmlBeanValidator(requestManager, runtime, option.isHtmlBeanValidationErrorWarned(), response); }