Validator 인터페이스

JD_S·2022년 10월 12일
0

스프링 Validation

  • 스프링 프레임워크는 Validation 추상화를 제공 한다.
  • org.springframwork.Validation.Validator는 객체를 검증하기 위한 인터페이스이다.

Validator 인터페이스

  • Validator 인터페이스를 상속한 클래스는 다음 두 메서드를 구현해야 한다.
  • boolean supports(Class clazz) : 매개변수(clazz)로 들어온 클래스가 Validator가 검증 할 수 있는 클래스 인지 판단하는 메서드이다.
  • void validate(Object target, Errors error) : 실제 검증 로직이 이루어지는 메서드이다.
profile
Whatever does not destroy me makes me stronger.

0개의 댓글