Interface RequestValidator

All Known Subinterfaces:
CartVersionRequestValidator
All Known Implementing Classes:
CartItemModifyingRequestValidator, CartModifyingRequestValidator, ShareItemListRequestValidator

public interface RequestValidator
Validates a Request Body.
Author:
Jacob Mitash
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    supports(Class<?> clazz)
    Tells whether this validator supports the given type.
    default void
    validate(Object requestBody)
    Validates the given request body.
    void
    validate(Object requestBody, org.springframework.validation.Errors errors)
    Validates the given request body.
  • Method Details

    • supports

      boolean supports(Class<?> clazz)
      Tells whether this validator supports the given type.
      Parameters:
      clazz - the class of the instance that will be tested/validated
      Returns:
      true if this validator can support the given type, false otherwise
    • validate

      default void validate(Object requestBody)
      Validates the given request body.
      Parameters:
      requestBody - the request body to validate
      Throws:
      com.broadleafcommerce.common.error.validation.ValidationException - if the request body is invalid
    • validate

      void validate(Object requestBody, org.springframework.validation.Errors errors)
      Validates the given request body.
      Parameters:
      requestBody - the request body to validate
      errors - the errors to contribute to when validation errors occur