类 CustomValidatorBean
- java.lang.Object
- org.springframework.validation.beanvalidation.SpringValidatorAdapter
- org.springframework.validation.beanvalidation.CustomValidatorBean
- 所有已实现的接口:
Validator
,InitializingBean
,SmartValidator
,Validator
public class CustomValidatorBean extends SpringValidatorAdapter implements Validator, InitializingBean
Configurable bean class that exposes a specific JSR-303 Validator through its original interface as well as through the SpringValidator
interface.- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 CustomValidatorBean()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
setMessageInterpolator(MessageInterpolator messageInterpolator)
Specify a custom MessageInterpolator to use for this Validator.void
setTraversableResolver(TraversableResolver traversableResolver)
Specify a custom TraversableResolver to use for this Validator.void
setValidatorFactory(ValidatorFactory validatorFactory)
Set the ValidatorFactory to obtain the target Validator from.从类继承的方法 org.springframework.validation.beanvalidation.SpringValidatorAdapter
determineErrorCode, determineField, getArgumentsForConstraint, getConstraintsForClass, getRejectedValue, getResolvableField, processConstraintViolations, supports, unwrap, validate, validate, validate, validateProperty, validateValue
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 javax.validation.Validator
getConstraintsForClass, unwrap, validate, validateProperty, validateValue
构造器详细资料
CustomValidatorBean
public CustomValidatorBean()
方法详细资料
setValidatorFactory
public void setValidatorFactory(ValidatorFactory validatorFactory)
Set the ValidatorFactory to obtain the target Validator from.Default is
Validation.buildDefaultValidatorFactory()
.
setMessageInterpolator
public void setMessageInterpolator(MessageInterpolator messageInterpolator)
Specify a custom MessageInterpolator to use for this Validator.
setTraversableResolver
public void setTraversableResolver(TraversableResolver traversableResolver)
Specify a custom TraversableResolver to use for this Validator.
afterPropertiesSet
public void afterPropertiesSet()
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean