本文整理匯總了Java中org.springframework.validation.Validator.supports方法的典型用法代碼示例。如果您正苦於以下問題:Java Validator.supports方法的具體用法?Java Validator.supports怎麽用?Java Validator.supports使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.validation.Validator
的用法示例。
在下文中一共展示了Validator.supports方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: supports
import org.springframework.validation.Validator; //導入方法依賴的package包/類
@Override
public boolean supports(final Class<?> clazz) {
for (final Validator validator : validators) {
if (validator.supports(clazz)) {
return true;
}
}
return false;
}
示例2: validate
import org.springframework.validation.Validator; //導入方法依賴的package包/類
@Override
public void validate(final Object target, final Errors errors) {
for (final Validator validator : validators) {
if (validator.supports(target.getClass())) {
validator.validate(target, errors);
}
}
}
示例3: supportedValidatorsFor
import org.springframework.validation.Validator; //導入方法依賴的package包/類
private Validator[] supportedValidatorsFor(Class<?> clazz) {
final Set<Validator> supportedValidators = new HashSet<>();
for (Validator validator : validators) {
if (validator.supports(clazz)) {
supportedValidators.add(validator);
}
}
return supportedValidators.toArray(new Validator[supportedValidators.size()]);
}
示例4: bind
import org.springframework.validation.Validator; //導入方法依賴的package包/類
/**
* Bind request parameters onto the given command bean
* @param request request from which parameters will be bound
* @param command command object, that must be a JavaBean
* @throws Exception in case of invalid state or arguments
*/
protected void bind(HttpServletRequest request, Object command) throws Exception {
logger.debug("Binding request parameters onto MultiActionController command");
ServletRequestDataBinder binder = createBinder(request, command);
binder.bind(request);
if (this.validators != null) {
for (Validator validator : this.validators) {
if (validator.supports(command.getClass())) {
ValidationUtils.invokeValidator(validator, command, binder.getBindingResult());
}
}
}
binder.closeNoCatch();
}
示例5: determineValidator
import org.springframework.validation.Validator; //導入方法依賴的package包/類
private Validator determineValidator(Object bean) {
Validator validator = getValidator();
boolean supportsBean = (validator != null && validator.supports(bean.getClass()));
if (ClassUtils.isAssignable(Validator.class, bean.getClass())) {
if (supportsBean) {
return new ChainingValidator(validator, (Validator) bean);
}
return (Validator) bean;
}
return (supportsBean ? validator : null);
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:12,代碼來源:ConfigurationPropertiesBindingPostProcessor.java
示例6: supports
import org.springframework.validation.Validator; //導入方法依賴的package包/類
@Override
public boolean supports(Class<?> clazz) {
for (Validator validator : this.validators) {
if (validator.supports(clazz)) {
return true;
}
}
return false;
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:ConfigurationPropertiesBindingPostProcessor.java
示例7: validate
import org.springframework.validation.Validator; //導入方法依賴的package包/類
@Override
public void validate(Object target, Errors errors) {
for (Validator validator : this.validators) {
if (validator.supports(target.getClass())) {
validator.validate(target, errors);
}
}
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:ConfigurationPropertiesBindingPostProcessor.java