當前位置: 首頁>>代碼示例>>Java>>正文


Java Validator.supports方法代碼示例

本文整理匯總了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;
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:10,代碼來源:WebConfiguratie.java

示例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);
        }
    }
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:9,代碼來源:WebConfiguratie.java

示例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()]);
}
 
開發者ID:suomenriistakeskus,項目名稱:oma-riista-web,代碼行數:10,代碼來源:CommonControllerAdvice.java

示例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();
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:20,代碼來源:MultiActionController.java

示例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


注:本文中的org.springframework.validation.Validator.supports方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。