public class ValidatorAdapter extends Object implements SmartValidator, ApplicationContextAware, InitializingBean, DisposableBean
Validator implementation that delegates calls to another Validator.
This Validator implements Spring's SmartValidator interface but does
not implement the JSR-303 javax.validator.Validator interface.| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy() |
static Validator |
get(ApplicationContext applicationContext,
Validator validator)
|
Validator |
getTarget() |
void |
setApplicationContext(ApplicationContext applicationContext) |
boolean |
supports(Class<?> clazz) |
void |
validate(Object target,
Errors errors) |
void |
validate(Object target,
Errors errors,
Object... validationHints) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateValuepublic final Validator getTarget()
public void validate(Object target, Errors errors, Object... validationHints)
validate in interface SmartValidatorpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void destroy()
throws Exception
destroy in interface DisposableBeanExceptionpublic static Validator get(ApplicationContext applicationContext, Validator validator)
Validator that only implements the Validator interface,
wrapping it if necessary.
If the specified Validator is not null, it is wrapped. If not, a
Validator is retrieved from the context and wrapped.
Otherwise, a new default validator is created.
applicationContext - the application contextvalidator - an existing validator to use or null