001package io.avaje.http.api;
002
003/**
004 * Validator for form beans or request beans.
005 */
006public interface Validator {
007
008  /**
009   * Validate the bean throwing an exception if the bean fails validation.
010   * <p>
011   * Typically the exception will be handled by a specific exception handler
012   * returning a 422 or 400 status code and usually a map of field paths to error messages.
013   *
014   * @param bean The bean to validate
015   */
016  void validate(Object bean);
017}